To create a socket in the local namespace, use the constant
PF_LOCAL
as the namespace argument to socket
or
socketpair
. This constant is defined in `sys/socket.h'.
PF_Local
is the
macro used by Posix.1g.
PF_LOCAL
, for compatibility's sake.
PF_LOCAL
, for compatibility's sake.
The structure for specifying socket names in the local namespace is defined in the header file `sys/un.h':
short int sun_family
AF_LOCAL
to designate the local
namespace. See section Socket Addresses.
char sun_path[108]
alloca
to allocate an appropriate amount of storage based on
the length of the filename.
You should compute the length parameter for a socket address in
the local namespace as the sum of the size of the sun_family
component and the string length (not the allocation size!) of
the file name string. This can be done using the macro SUN_LEN
:
Go to the first, previous, next, last section, table of contents.