unix.7: Clarify treatment of incoming ancillary data if 'msg_control' is NULL

If no buffer is supplied for incoming ancillary data, then
the data is lost.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2018-07-15 10:22:58 +02:00
parent 4564dd1fee
commit c0e56ed687
1 changed files with 10 additions and 2 deletions

View File

@ -447,12 +447,20 @@ When sending ancillary data with
.BR sendmsg (2),
only one item of each of the above types may be included in the sent message.
.PP
If the space allocated for receiving incoming ancillary data is too small,
If the space allocated for receiving incoming ancillary data is too small
then the ancillary data is truncated to the number of headers
that will fit in the supplied buffer (or, in the case of an
.BR SCM_RIGHTS
file descriptor list, the list of file descriptors may be truncated).
In the event of such truncation, the
If no buffer is provided for incoming ancillary data (i.e., the
.I msg_control
field of the
.I msghdr
structure supplied to
.BR recvmsg (2)
is NULL),
then the incoming ancillary data is discarded.
In both of these cases, the
.BR MSG_CTRUNC
flag will be set in the
.I msg.msg_flags