From 8bdcf4bf818acfb609be7004c80173199a9e35c0 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 8 Jul 2018 10:30:32 +0200 Subject: [PATCH] unix.7: There is a limit on the size of the file descriptor array for SCM_RIGHTS The limit is defined in the kernel as SCM_MAX_FD (253). 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 d16cc30a8..46b1914b8 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -371,6 +371,19 @@ Send or receive a set of open file descriptors from another process. The data portion contains an integer array of the file descriptors. The passed file descriptors behave as though they have been created with .BR dup (2). +.IP +The kernel constant +.BR SCM_MAX_FD +defines a limit on the number of file descriptors in the array. +Attempting to send an array larger than this limit cause +.BR sendmsg (2) +to fail with the error +.BR EINVAL . +.BR SCM_MAX_FD +has the value 253 +(or 255 in kernels +.\" commit bba14de98753cb6599a2dae0e520714b2153522d +before 2.6.38). .TP .B SCM_CREDENTIALS Send or receive UNIX credentials.