Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Nov 2001 11:03:05 +0200
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc:        "Andrew R. Reiter" <arr@FreeBSD.org>, freebsd-current@FreeBSD.org
Subject:   Re: libfetch kqueue patch
Message-ID:  <3C0356C9.C1F33D8F@FreeBSD.org>
References:  <20011126201312.A75451@walton.maths.tcd.ie> <Pine.NEB.3.96L.1011126152347.97819A-100000@fledge.watson.org> <200111262032.fAQKWpY21910@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote:
> 
> <<On Mon, 26 Nov 2001 15:27:45 -0500 (EST), "Andrew R. Reiter" <arr@FreeBSD.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C0356C9.C1F33D8F>