From c0e56ed687f4bae9adc2af19119917fbd8f552d2 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 15 Jul 2018 10:22:58 +0200 Subject: [PATCH] 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 --- man7/unix.7 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/man7/unix.7 b/man7/unix.7 index 17a10d3db..07f9e9bf3 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -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