Subject: Re: sys_select() EBADF bug
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 11/16/2002 01:08:11
>> 	- we can have file descriptor larger than FD_SETSIZE.
>> 	- we can pass fd_set bitmap larger than FD_SETSIZE okay.
>> 	  (see usr.sbin/traceroute6/traceroute6.c for instance)
>> 	so i don't see the need for returning error when nfds > FD_SETSIZE.

> No - that code is broken, or at least not fully portable.

> Not least because is assumes the format of fd_set - which is not
> public.

Well, FD_SETSIZE is not a constant system-wide.  As the manpage for
select(2) notes, if you define FD_SETSIZE as a larger-than-default
value before your includes, you can raise the effective limit and still
use the FD_* macros without the code having to know anything about the
format of an fd_set.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B