diff --git a/man7/unix.7 b/man7/unix.7 index 05681f031..3f41ad4cc 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -534,6 +534,33 @@ versus .TP .B ESOCKTNOSUPPORT Unknown socket type. +.TP +.B ETOOMANYREFS +This error can occur for +.BR sendmsg (2) +when sending a file descriptor as ancilary data over +a UNIX domain socket (see the description of +.BR SCM_RIGHTS , +above). +It occurs if the number of "in-flight" file descriptors exceeds the +.B RLIMIT_NOFILE +resource limit and the caller does not have the +.BR CAP_SYS_RESOURCE +capability. +An in-flight file descriptor is one that has been sent using +.BR sendmsg (2) +but has not yet been accepted in the recipient process using +.BR recvmsg (2). + +This error is diagnosed since Linux 4.5. +.\" commit 712f4aad406bb1ed67f3f98d04c044191f0ff593 +In earlier kernel versions, +it was possible to place an unlimited number of file descriptors in flight, +by sending each file descriptor with +.BR sendmsg (2) +and then closing the file descriptor so that it was not accounted against the +.B RLIMIT_NOFILE +resource limit. .PP Other errors can be generated by the generic socket layer or by the filesystem while generating a filesystem socket object.