[erlang-questions] unix domain sockets with abstract namespace: can't use all 108 bytes

Richard A. O'Keefe ok@REDACTED
Wed Mar 29 03:08:42 CEST 2017


> On 28/03/2017, at 11:05 PM, Raimo Niskanen <raimo+erlang-questions@REDACTED> wrote:
> I see no good way to know for all platforms if the address is supposed to
> be zero terminated or not.  Linux utilizes the special case that if the
> first byte is zero then it is not zero terminated.  I do not know if that
> is a safe indicator on all platforms.

The Linux manual page is quite specific:
  "a Unix domain socket can be bound to a >>>null-terminated<<<
   file system pathname"

  "an abstract socket address" begins with a NUL byte. "All of the
  remaining bytes define the 'name' of the socket."  "The abstract
  socket namespace is a non-portable Linux extension."

Sounds like any "fix" in Erlang's guts would need to be Linux-specific
and leading NUL bytes should probably be reported as errors on other
systems.





More information about the erlang-questions mailing list