From c87721467e21e060c332ca53f3f4ec6e01686c17 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 8 Jul 2018 11:00:23 +0200 Subject: [PATCH] unix.7: Note behavior if buffer to receive ancillary data is too small If the buffer supplied to recvmsg() to receive ancillary data is too small, then the data is truncated and the MSG_CTRUNC flag is set. Signed-off-by: Michael Kerrisk --- man7/unix.7 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/man7/unix.7 b/man7/unix.7 index 0850ebc1b..e4c19324d 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -435,6 +435,19 @@ To receive a message, the .B SO_PASSCRED option must be enabled on the socket. +.PP +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 +.BR MSG_CTRUNC +flag will be set in the +.I msg.msg_flags +value returned by +.BR recvmsg (2). +.\" .SS Ioctls The following .BR ioctl (2)