Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2001 15:27:45 -0500 (EST)
From:      "Andrew R. Reiter" <arr@FreeBSD.org>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>, Maxim Sobolev <sobomax@FreeBSD.org>, Dag-Erling Smorgrav <des@ofug.org>, freebsd-current@FreeBSD.org
Subject:   Re: libfetch kqueue patch
Message-ID:  <Pine.NEB.3.96L.1011126152347.97819A-100000@fledge.watson.org>
In-Reply-To: <20011126201312.A75451@walton.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help

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
arr@watson.org
arr@FreeBSD.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1011126152347.97819A-100000>