Expand description
Unix Domain Sockets (AF_UNIX)
Provides local inter-process communication via the BSD socket API with path-based addressing. Used by Wayland compositors for client-server communication and by system daemons for local service connections.
Supported features:
- Stream (SOCK_STREAM) and datagram (SOCK_DGRAM) modes
- Path-based binding (
/run/wayland-0,/tmp/.X11-unix/X0) socketpair()for anonymous connected socket pairs- SCM_RIGHTS for file descriptor passing (Wayland buffer handles)
- Backlog queue for pending connections
Structs§
- ScmRights
- Ancillary data for SCM_RIGHTS file descriptor passing.
- Unix
Message - A message in the Unix socket buffer.
- Unix
Socket - A Unix domain socket.
Enums§
- Unix
Socket State - Unix socket state.
- Unix
Socket Type - Unix socket type.
Constants§
- SCM_
RIGHTS_ MAX - Maximum number of file descriptors in a single SCM_RIGHTS message.
- UNIX_
BACKLOG_ MAX - Maximum backlog for pending connections.
- UNIX_
DGRAM_ MAX - Maximum message size for datagram mode.
- UNIX_
PATH_ MAX - Maximum path length for a Unix socket address.
- UNIX_
SOCKET_ MAX - Maximum number of concurrent Unix sockets.
Functions§
- socket_
accept - Accept a pending connection on a listening socket.
- socket_
bind - Bind a Unix socket to a filesystem path.
- socket_
close - Close a Unix socket.
- socket_
connect - Connect a stream socket to a listening socket at the given path.
- socket_
count - Get the number of active Unix sockets.
- socket_
create - Create a new Unix domain socket.
- socket_
listen - Start listening for incoming connections (stream sockets only).
- socket_
recv - Receive data from a connected or datagram socket.
- socket_
send - Send data on a connected socket.
- socket_
sendto - Send a datagram to a named socket (connectionless).
- socketpair
- Create an anonymous connected socket pair (socketpair).