lkml.org 
[lkml]   [2020]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectDoes SCM_RIGHTS limit on fd array apply to a particular cmsghdr or the whole ancillary data?
Date
Hi,

in the documentation on SCM_RIGHTS the maximum number of file
descriptors that can be passed is described as (release 5.09 of the
Linux man-pages project):

| SCM_RIGHTS
| Send or receive a set of open file descriptors from another
| process. The data portion contains an integer array of the file
| descriptors.
| (...)
| The kernel constant SCM_MAX_FD defines a limit on the number of
| file descriptors in the array. Attempting to send an array
| larger than this limit causes sendmsg(2) to fail with
the error | EINVAL.

In my reading this might be interpreted as SCM_MAX_FD per SCM_RIGHTS
cmsghdr, xor SCM_MAX_FD per sendmsg. It would be good to know, which one
it is. So which is the proper strategy if I have to pass more than
SCM_MAX_FD file descriptors between processes?


Cheers,
Wolfgang

\
 
 \ /
  Last update: 2020-12-09 20:32    [W:0.052 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site