Abstract namespace for Unix domain sockets under Linux

Linux allows an "abstract namespace" for Unix domain sockets, in which sockets do not have to be associated with a path in the filesystem. This was introduced in Linux 2.2.

Processes request the abstract namespace by setting the first byte of sun_path in "struct sockaddr_un" to zero. The rest of the bytes (upto the length passed to bind()/connect()) make up the name. The name is not null-terminated, unlike normal domain socket pathnames.

Unfortunately, this design makes it very difficult to search for uses, because there is no keyword to search for.

I have not found anything explaining why this was introduced.

See also PlashIssues/DomainSocketAbstractNamespace.

Questions

Who uses this facility?

strace reports these socket names as path=@... instead of path="...".

DBus: Confusingly, it uses a pathname such as /tmp/XXXX as the abstract name. DBus can be configured to use or not use abstract names with the <listen> setting in /etc/dbus-1/system.conf.

DomainSocketAbstractNamespace (last edited 2007-04-28 15:33:03 by MarkSeaborn)