Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group

Use of Sockets for Local UNIX Connections

Support for UNIX-Domain sockets is mandatory.

UNIX domain sockets provide process-to-process communication in a single system.

Headers
Symbolic constant AF_UNIX is defined in <sys/socket.h> (see <sys/socket.h>) to identify the UNIX domain address family. Header <sys/un.h> (see <sys/un.h>) contains other definitions used in connection with UNIX domain sockets.

The sockaddr_storage structure defined in <sys/socket.h> is large enough to accommodate a sockaddr_un structure (see <sys/un.h>) and is aligned at an appropriate boundary so that pointers to it can be cast as pointers to sockaddr_un structures and used to access the fields of those structures without alignment problems. When a sockaddr_storage structure is cast as a sockaddr_un structure, the ss_family field maps onto the sun_family field.

Contents Next section Index