Subject: kern/281: select(getdtablesize(),...) returns EINVAL
To: None <gnats-admin>
From: Matthieu Herrb <matthieu@laas.fr>
List: netbsd-bugs
Date: 06/05/1994 23:50:01
>Number: 281
>Category: kern
>Synopsis: select(getdtablesize(),...) returns EINVAL
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: gnats-admin (Kernel Bug People)
>State: open
>Class: change-request
>Submitter-Id: matthieu
>Arrival-Date: Sun Jun 5 23:50:00 1994
>Originator: Matthieu Herrb
>Organization:
"LAAS/CNRS (Toulouse France)"
>Release: 94/05/27
>Environment:
System: NetBSD cougar 0.9B NetBSD 0.9B (COUGAR) #0: Sat May 28 17:01:51 MET DST 1994 matthieu@cougar:/usr/src/sys/arch/i386/compile/COUGAR i386
>Description:
With a standard kernel, the max number of file descriptors per process
is greater than FD_SETSIZE.
So programs that use getdtablesize() return value as 1st argument in
select() allways see it fail with errno set to EINVAL.
>How-To-Repeat:
select(getdtablesize(), NULL, NULL, NULL, NULL);
>Fix:
Either:
1. Augment the default FD_SETSIZE value
2. Silently ignore too big values for select() first
argument (in src/sys/kern/sys_generic.c:517
3. At least document it in select() man page.
>Audit-Trail:
>Unformatted:
------------------------------------------------------------------------------