From owner-freebsd-current Wed Nov 28 10: 2:38 2001 Delivered-To: freebsd-current@freebsd.org Received: from alcatraz.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by hub.freebsd.org (Postfix) with ESMTP id B91D437B417; Wed, 28 Nov 2001 10:02:27 -0800 (PST) Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by alcatraz.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id LAA62092; Tue, 27 Nov 2001 11:03:07 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (h199.229.dialup.iptcom.net [212.9.229.199]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id LAA91801; Tue, 27 Nov 2001 11:00:56 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.6/8.11.3) with ESMTP id fAR90PY28419; Tue, 27 Nov 2001 11:00:25 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3C0356C9.C1F33D8F@FreeBSD.org> Date: Tue, 27 Nov 2001 11:03:05 +0200 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Garrett Wollman Cc: "Andrew R. Reiter" , freebsd-current@FreeBSD.org Subject: Re: libfetch kqueue patch References: <20011126201312.A75451@walton.maths.tcd.ie> <200111262032.fAQKWpY21910@khavrinen.lcs.mit.edu> Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 7bit 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 Garrett Wollman wrote: > > < said: > > > As from OpenBSD (in shorter form): > > > fd_set *fds = calloc(howmany(fd+1, NFDBITS), sizeof(fd_mask)); > > But this is not portable. The application is not allowed to assume > anything about the structure of an fd_set, or the existence of a type > `fd_mask', or the existence of a macro `howmany' (which is actually > prohibited). The only portable (in the sense of officially > standardized) interface that doesn't suffer from this problem is > poll(). This answers your original concern - convert it to use poll(2) instead of select(2) and you will be safe from the "out of default fd_set" without loosing portability. -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message