Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

select and FD_SETSIZE

2 views
Skip to first unread message

Srivathsan Nadathur

unread,
Nov 25, 1997, 3:00:00 AM11/25/97
to

Hi Everyone,

Does anybody know how to make select work for file descriptors
whose values are more than 1024. I defined FD_SETSIZE
to 2048 before inclusion of any of the system files.
Still, select comes out with an error "invalid argument" if there
is a file descriptor in the fd_set whose value is more than 1024.

I am facing this problem on UNIXWARE (both in gemini(beta) and
2.1.2 version).

I have been unable to test this under solaris (2.5.1) because
I have no idea how to increase the per process file limit to more
than 1024. ulimit -a currently shows nfiles to be 1024. Does anybody
know how to increase this value to beyond 1024.


Thanks,
Srivathsan
--
-----------------------------------------------------------------------------
Srivathsan Nadathur
Phone: 908 949 9835(W) Email: snad...@bell-labs.com
-----------------------------------------------------------------------------

W. Richard Stevens

unread,
Nov 26, 1997, 3:00:00 AM11/26/97
to

> Does anybody know how to make select work for file descriptors
> whose values are more than 1024. I defined FD_SETSIZE
> to 2048 before inclusion of any of the system files.
> Still, select comes out with an error "invalid argument" if there
> is a file descriptor in the fd_set whose value is more than 1024.
>
> I am facing this problem on UNIXWARE (both in gemini(beta) and
> 2.1.2 version).

Unfortunately, it depends on the implementation. Many have FD_SETSIZE
compiled into the kernel (line 406, page 526 of "TCP/IP Illustrated",
Volume 2) so #defining it yourself won't help. Assuming lack of source
code you just have to try it or ask the vendor.

Rich Stevens

har...@rastamon.local.org

unread,
Nov 28, 1997, 3:00:00 AM11/28/97
to

W. Richard Stevens (rste...@noao.edu) wrote:
: > Does anybody know how to make select work for file descriptors

: Rich Stevens

Or don't use fd's; you could use fifos instead so you go through the
filesystem where there is no (realistic) limit on the number of
read/write objects you can have.

Then open one well-known fifo through which other processes will
make known their intention to read/write from/to you.

You'd probably take a performance hit :)

-harold

Elias Martenson

unread,
Dec 1, 1997, 3:00:00 AM12/1/97
to

har...@rastamon.local.org () writes:

Or, he could use poll(2) which I assume exists on Unixware (it being SVR4).

--
Elias Martenson
elias.martenson (atsign) sweden.sun.com

Srivathsan Nadathur

unread,
Dec 1, 1997, 3:00:00 AM12/1/97
to

Hi ,

Thanks for the inputs. poll works fine for file descriptors whose values
are more than 1024. The limitation with select, appartently, is imposed
by the implementation in libc.

Thanks again,
Srivathsan.


Doug Siebert

unread,
Dec 1, 1997, 3:00:00 AM12/1/97
to

Srivathsan Nadathur <snad...@bell-labs.com> writes:

>Thanks for the inputs. poll works fine for file descriptors whose values
>are more than 1024. The limitation with select, appartently, is imposed
>by the implementation in libc.


If libc is the problem you ought to be able to write your own wrapper for
the sys_select syscall...

--
Douglas Siebert Director of Computing Facilities
douglas...@uiowa.edu Division of Mathematical Sciences, U of Iowa

If you let the system beat you long enough, eventually it'll get tired.

0 new messages