The domain is specified as a manifest constant. For the UNIX domain,
the constant is always AF_UNIX (address
family_UNIX domain). The manifest constants are named
AF_whatever because they indicate the ``address family'' to use in
interpreting names.
type
Types are:
SOCK_STREAM
SOCK_DGRAM
protocol
For UNIX domain sockets, the protocol must be set to 0.
Unlike the Internet domain, the UNIX domain does not allow
a choice of protocols. The system returns a small integer
descriptor, or handle, to use in later system calls which operate
on sockets. This is equivalent to a file descriptor. See
open(S).
The socket call also requires the <sys/stdio.h>
include file. For example, to create a datagram socket for on-machine use: