> Are you sure?

    The code references the per-process limit
    (p->p_rlimit[RLIMIT_NOFILE].rlim_cur).

> That would mean that the pollfd array is larger than the amount
> of open files you're allowed.

    Right, the concatenation of multiple pollfd arrays does not
    eliminate multiple occurences of fds in userland.  So, we
    might end up with n * p_rlimit[RLIMIT_NOFILE] entries where n
    is any number >= 1.  I have not evaluated yet the feasibility
    of eliminating multiple occurences as that would involve
    adding complexity for a special case to quite generic code.

> I think it may be a good idea to actually allow double
> RLIMIT_NOFILE and FD_SETSIZE for flexibility.

    Yes.  What do you think about adding a sysctl which defines
    the maximum size (e.g. kern.maxpollfds)?  That could be
    initialized to kern.maxfilesperproc to maintain the current
    behaviour.

    - 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