As from OpenBSD (in shorter form):

        fd_set *fds = calloc(howmany(fd+1, NFDBITS), sizeof(fd_mask));
        FD_SET(fd, fds);
        select(fd+1, fds...);

As for being "portable", the only thing I've seen that is nice and neat is
libevent from Niels Provos, but I think some people had "issues" with the
way it handled kqueue support.


On Mon, 26 Nov 2001, David Malone wrote:

:On Mon, Nov 26, 2001 at 03:04:56PM -0500, Andrew R. Reiter wrote:
:> Agreed, or people could code with select in a nice manner and dynamically
:> allocate the fd_set arrays.
:
:Is there a portable way to allocate dynamically sized fd_sets? It
:could easily be one of those things that you're not supposed to
:know how it works inside.
:
:       David.
:

--
Andrew R. Reiter
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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

Reply via email to