Hi,

    one of my applications uses the SGI State Threads Library
    (I/O multiplexing scheduler).  At its heart is a function
    which concatenates the pollfd arrays of all threads and calls
    poll(2).  As sockets are shared between threads, the size of
    the final pollfd array can easily be greater than
    RLIMIT_NOFILE.

    Unfortunately, it is impossible to poll more than
    RLIMIT_NOFILE descriptors with one system call.  This is
    caused by a check in sys/sys_generic.c which was introduced
    three months ago:

    /*
     * This is kinda bogus.  We have fd limits, but that is not
     * really related to the size of the pollfd array.  Make sure
     * we let the process use at least FD_SETSIZE entries and at
     * least enough for the current limits.  We want to be reasonably
     * safe, but not overly restrictive.
     */
    if (nfds > p->p_rlimit[RLIMIT_NOFILE].rlim_cur && nfds > FD_SETSIZE)
        return (EINVAL);

    What is the chance of getting this changed?  Or, at least
    documented?

         [EINVAL]           The specified time limit is negative.

    Thanks,
    - Sascha                                     Experience IRCG
      http://schumann.cx/                http://schumann.cx/ircg


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to