text
stringlengths
0
234
.br socketpair (2).
.\"
.ss autobind feature
if a
.br bind (2)
call specifies
.i addrlen
as
.ir sizeof(sa_family_t) ,
.\" i.e., sizeof(short)
or the
.br so_passcred
socket option was specified for a socket that was
not explicitly bound to an address,
then the socket is autobound to an abstract address.
the address consists of a null byte
followed by 5 bytes in the character set
.ir [0\-9a\-f] .
thus, there is a limit of 2^20 autobind addresses.
(from linux 2.1.15, when the autobind feature was added,
8 bytes were used, and the limit was thus 2^32 autobind addresses.
the change to 5 bytes came in linux 2.3.15.)
.ss sockets api
the following paragraphs describe domain-specific details and
unsupported features of the sockets api for unix domain sockets on linux.
.pp
unix domain sockets do not support the transmission of
out-of-band data (the
.b msg_oob
flag for
.br send (2)
and
.br recv (2)).
.pp
the
.br send (2)
.b msg_more
flag is not supported by unix domain sockets.
.pp
before linux 3.4,
.\" commit 9f6f9af7694ede6314bed281eec74d588ba9474f
the use of
.b msg_trunc
in the
.i flags
argument of
.br recv (2)
was not supported by unix domain sockets.
.pp
the
.b so_sndbuf
socket option does have an effect for unix domain sockets, but the
.b so_rcvbuf
option does not.
for datagram sockets, the
.b so_sndbuf
value imposes an upper limit on the size of outgoing datagrams.
this limit is calculated as the doubled (see
.br socket (7))
option value less 32 bytes used for overhead.
.ss ancillary messages
ancillary data is sent and received using
.br sendmsg (2)
and
.br recvmsg (2).
for historical reasons, the ancillary message types listed below
are specified with a
.b sol_socket
type even though they are
.b af_unix
specific.
to send them, set the
.i cmsg_level
field of the struct
.i cmsghdr
to
.b sol_socket
and the
.i cmsg_type
field to the type.
for more information, see
.br cmsg (3).
.tp
.b scm_rights
send or receive a set of open file descriptors from another process.
the data portion contains an integer array of the file descriptors.
.ip
commonly, this operation is referred to as "passing a file descriptor"
to another process.
however, more accurately,
what is being passed is a reference to an open file description (see
.br open (2)),
and in the receiving process it is likely that a different
file descriptor number will be used.
semantically, this operation is equivalent to duplicating
.rb ( dup (2))
a file descriptor into the file descriptor table of another process.
.ip
if the buffer used to receive the ancillary data containing
file descriptors is too small (or is absent),