A Unix domain socket (UDS), also called a local socket or inter-process communication (IPC) socket, is a communication endpoint used for data exchange between processes running on the same Unix or Unix-like operating system.
The term Unix domain socket refers to the <code>domain</code> argument value <code>AF_UNIX</code> passed to the system call that creates the socket. The same communication domain can also be selected with <code>AF_LOCAL</code>.
Valid <code>type</code> argument values for a UDS are:
The UDS facility is a standard component of a POSIX operating system.
The API for a UDS is similar to that of an Internet socket, but instead of using an underlying network protocol, communication takes place entirely within the operating system kernel. A UDS may use the file system as its address namespace. Some operating systems, such as Linux, provide additional namespaces. Processes refer to a UDS through a file system inode, allowing two processes to communicate by opening the same socket.
In addition to sending data, processes can pass file descriptors over a UDS connection by using the <code>sendmsg()</code> and <code>recvmsg()</code> system calls. This allows one process to grant another process access to a file descriptor that it would not otherwise be able to use. This can be used to implement a rudimentary form of capability-based security.