Addressing within the AF_UNIX domain

A socket address in the AF_UNIX address family is comprised of three fields: the length of the following pathname, the address family (AF_UNIX), and the pathname itself. The structure of an AF_UNIX socket address is defined as follows:
 struct sockaddr_un {
    unsigned char  sun_len;
    unsigned char  sun_family;
	     char  sun_path[108];        /* pathname */
};

This structure is defined in the sockaddr_un structure found in sys/un.h include file. The sun_len contains the length of the pathname in sun_path; sun_family field is set to AF_UNIX; and sun_path contains the null-terminated pathname.