unix.7: If the buffer to receive SCM_RIGHTS FDs is too small, FDs are closed

If the ancillary data buffer for receiving SCM_RIGHTS file
descriptors is too small, then the excess file descriptors are
automatically closed in the receiving process. Verified by
experiment.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2018-07-15 09:53:35 +02:00
parent b65f4c691d
commit 4564dd1fee
1 changed files with 6 additions and 0 deletions

View File

@ -381,6 +381,12 @@ 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),
then the ancillary data is truncated (or discarded)
and the excess file descriptors are automatically closed
in the receiving process.
.IP
The kernel constant
.BR SCM_MAX_FD
defines a limit on the number of file descriptors in the array.