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
-----------------------------------------------------------------------------
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
: 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
Or, he could use poll(2) which I assume exists on Unixware (it being SVR4).
--
Elias Martenson
elias.martenson (atsign) sweden.sun.com
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.
>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.