Hmm ... FreeBSD gets round this by allowing you to
redefine FD_SETSIZE in your own programs before you
include any header files. The kernel deals with this
automagically in select() by looking at the max fd
you passed and assuming you passed a bitmap large
enough to cope. I've successfully run FreeBSD with
MAX_OPEN (OPEN_MAX?) of nearly 4000 and done a select
with > 256 fd's.
I'm not a FreeBSD advocate, by the way, but this does
seem to be one thing they got right :-)
Rich.
(I quote from /usr/include/sys/types.h)
/*
* Select uses bit masks of file descriptors in longs. These macros
* manipulate such bit fields (the filesystem macros use chars).
* FD_SETSIZE may be defined by the user, but the default here should
* be enough for most uses.
*/
#ifndef FD_SETSIZE
#define FD_SETSIZE 256
#endif
typedef long fd_mask;
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
#ifndef howmany
#define howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
-- Richard Jones rjones@imcl.com Tel: +44 171 460 6141 Fax: .. 4461 ABLE INmEDIA Ltd. 262a Fulham Rd. London SW10 9EL. "you'll write in PGP: www.four11.com telegraphic, or you won't write at all" [Céline] To send me email, please leave this line in your reply: RJ-AUTH-DHQJENBA