Talk:Unix domain socket

Latest comment: 1 year ago by 2601:602:A080:1240:45D4:8FC9:967D:6C67 in topic Name

Filesystem edit

They are referenced by processes as inodes in the file system.

This is not quite correct. On several OS you can set the first byte of the pathname to 0, causing the following name to be looked up in a filesystem independent namespace (without any filesystem access control checks). Even from within a chroot.

Notes edit

The PF_UNIX (also known as PF_LOCAL) socket family is used to communicate between processes on the same machine efficiently. Unix sockets can be either anonymous (created by socketpair) or associated with a file of type socket. Linux also supports an abstract namespace which is independent of the file system.

Valid types are SOCK_STREAM for a stream oriented socket and SOCK_DGRAM for a datagram oriented socket that preserves message boundaries. Unix sockets are always reliable and don't reorder datagrams.

Unix sockets support passing file descriptors or process credentials to other processes using ancillary data. 220.225.70.2 04:58, 4 April 2007

Advertising based resources edit

Why do the external links point to copies of the Linux documentation on an ad-covered page, rather than the authoritative source? --David Chisnall (talk) 18:35, 19 November 2007 (UTC)Reply

Name edit

What does domain in Unix domain socket stand for? --Abdull (talk) 20:52, 9 March 2015 (UTC)Reply

It's essentially the standard English meaning of the word. It's the first parameter of socket(2). The Linux manpage calls it the "communication domain", if that helps, though I've never heard anyone call it that. — Preceding unsigned comment added by 2601:602:A080:1240:45D4:8FC9:967D:6C67 (talk) 02:41, 22 January 2023 (UTC)Reply

History or naming edit

I think a section on the historical derivation of "Unix domain sockets", or else an explanation of the name, is warranted. They are often called just "sockets" or "socket files" as well. The common synonyms (even if incorrect) and differentiation from commonly conflated entities would be a good addition.

DouglasHeld (talk) 17:47, 24 January 2022 (UTC)Reply