From 5219daec26a5fed7f73ccd66e898948abf89ccae Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 15 Jul 2018 10:30:11 +0200 Subject: [PATCH] unix.7: One must send at least one byte of real data with ancillary data When sending ancillary data, at least one byte of real data should also be sent. This is strictly necessary for stream sockets (verified by experiment). It is not required for datagram sockets on Linux (verified by experiment), but portable applications should do so. Signed-off-by: Michael Kerrisk --- man7/unix.7 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/man7/unix.7 b/man7/unix.7 index 07f9e9bf3..905d5bc2f 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -447,6 +447,14 @@ 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 +At least one byte of real data should be sent when sending ancillary data. +On Linux, this is required to successfully send ancillary data over +a UNIX domain stream socket. +When sending ancillary data over a UNIX domain datagram socket, +it is not necessary on Linux to send any accompanying real data. +However, portable applications should also include at least one byte +of real data when sending ancillary data over a datagram 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