⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module unix_socket

Module unix_socket 

Source
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.
UnixMessage
A message in the Unix socket buffer.
UnixSocket
A Unix domain socket.

Enums§

UnixSocketState
Unix socket state.
UnixSocketType
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).