[256] in Pthreads mailing list archive
Re: accept on FreeBSD 2.1
daemon@ATHENA.MIT.EDU (Christopher Provenzano)
Fri Feb 9 00:06:23 1996
To: jha@cs.purdue.edu ("John H. Aughey")
Cc: pthreads@MIT.EDU
In-Reply-To: Your message of "Tue, 06 Feb 1996 21:34:05 EST."
<199602070234.VAA26305@moriarty.cs.purdue.edu>
Date: Thu, 08 Feb 1996 23:41:24 EST
From: Christopher Provenzano <proven@MIT.EDU>
To: jha@cs.purdue.edu ("John H. Aughey")
cc: pthreads
Subject: Re: accept on FreeBSD 2.1
In-reply-to: Your message of "Tue, 06 Feb 1996 21:34:05 EST."
<199602070234.VAA26305@moriarty.cs.purdue.edu>
--------
This problem is probably caused when select() passes the number of file
descriptors (the first arg) larger than FD_SETSIZE. This causes select()
to return EINVAL. The solution is either to limit the number of file
descriptors your process can use to 256 or you can fix fd_init() in
pthread/fd.c to check dtablesize against FD_SETSIZE.
< /* select() can only handle FD_SETSIZE descriptors, so our inner loop will
< * break if dtablesize is higher than that. This should be removed if and
< * when the inner loop is rewritten to use poll(). */
< if (dtablesize > FD_SETSIZE) {
< dtablesize = FD_SETSIZE;
---
> /* This is again temporary and can be bumped up if necessary. */
> if (dtablesize > 1024) {
> dtablesize = 1024;
CAP