From owner-freebsd-current Mon Nov 26 12:28: 6 2001 Delivered-To: freebsd-current@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id A8BA037B405; Mon, 26 Nov 2001 12:28:02 -0800 (PST) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.6/8.11.5) with SMTP id fAQKRkU97866; Mon, 26 Nov 2001 15:27:46 -0500 (EST) (envelope-from arr@FreeBSD.org) X-Authentication-Warning: fledge.watson.org: arr owned process doing -bs Date: Mon, 26 Nov 2001 15:27:45 -0500 (EST) From: "Andrew R. Reiter" X-Sender: arr@fledge.watson.org To: David Malone Cc: Garrett Wollman , Maxim Sobolev , Dag-Erling Smorgrav , freebsd-current@FreeBSD.org Subject: Re: libfetch kqueue patch In-Reply-To: <20011126201312.A75451@walton.maths.tcd.ie> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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