Skip to main content

Module unix_socket

Module unix_socket 

Source
Expand description

Low-level Unix domain socket primitives.

This module exposes Linux/Android AF_UNIX stream socket mechanics only: bind, listen, accept, connect, chmod for filesystem sockets, peer credentials, and byte I/O through Fd. Callers own all protocol, message framing, authentication policy, daemon behavior, and socket naming.

Abstract socket names are Linux/Android-only. They are encoded with a leading NUL byte in sun_path; interior NUL bytes in the caller-provided abstract name are preserved because the kernel uses the explicit sockaddr length, not C string termination.

Structs§

PeerCred
Peer process credentials when the platform exposes them.
UnixListenerFd
Owned non-blocking Unix listener descriptor.
UnixSocketBindOptions
Bind options for a Unix stream listener.
UnixStreamFd
Owned non-blocking Unix stream descriptor.

Enums§

StaleSocketPolicy
Explicit stale pathname behavior for filesystem socket binds.
UnixConnectResult
Result of starting a non-blocking Unix stream connection.
UnixSocketAddr
Unix socket address.

Functions§

bind_unix_listener
Bind and listen on a non-blocking Unix stream socket.
chmod_socket_path
Change mode bits on a Unix socket filesystem path.
chmod_unix_socket
Change mode bits on a Unix socket filesystem path.
connect_unix_stream
Connect a non-blocking Unix stream socket.