Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2001 00:30:47 +0200 (MEST)
From:      Sascha Schumann <sascha@schumann.cx>
To:        <freebsd-hackers@freebsd.org>
Subject:   poll(2)'s arbitrary limit
Message-ID:  <Pine.LNX.4.33.0106170013280.3244-100000@rossini.schumann.cx>

next in thread | raw e-mail | index | archive | help
    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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.33.0106170013280.3244-100000>