This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: dumb question
- To: roland@frob.com
- Subject: Re: dumb question
- From: tb@MIT.EDU (Thomas Bushnell, n/BSG)
- Date: Tue, 30 Jun 1998 13:41:27 -0400
- Cc: aj@arthur.rhein-neckar.de, kukuk@weber.uni-paderborn.de, libc-hacker@cygnus.com
Date: Tue, 30 Jun 1998 12:59:32 -0400
From: Roland McGrath <roland@frob.com>
> The advantage of using poll instead of select is that glibc is not
> dependend anymore on FD_SETSIZE and doesn't need to be recompiled if
> the user changes NR_OPEN.
The select interface was designed specifically to avoid this problem,
if you use it right. You should never need to use FD_SETSIZE. You can
dynamically allocate as many bits as you need, and then you pass the max fd
number to select. If the kernel is not a piece of shit, this works fine.
This is true for the select call itself, but not the associated macros
for defining file descriptor sets.