JINMEI Tatuya writes:
> http://www.jinmei.org/selecttest.tgz
> See the README file contained in it about how to build and use it.
> Hope it helps.


Here is what I discovered in my testing so far.
On my NetBSD system (other BSDs are no doubt similar)
I needed to raise the system-wide limit on open
file descriptors, then raise the process limits,
then it would work.

John

malapert: {1} /tmp/selecttest
selecttest: nsocks = 4093, TEST_FDSETSIZE = -1, FD_SETSIZE = 256, sizeof fd_set = 32
opening 62th socket failed: Too many open files

malapert: {2} unlimit -h; unlimit
malapert: {3} /tmp/selecttest
selecttest: nsocks = 4093, TEST_FDSETSIZE = -1, FD_SETSIZE = 256, sizeof fd_set = 32
opening 1640th socket failed: Too many open files in system

pert: {4} sysctl -w kern.maxfiles=4500
kern.maxfiles: 1772 -> 4500
malapert: {5} /tmp/selecttest
selecttest: nsocks = 4093, TEST_FDSETSIZE = -1, FD_SETSIZE = 256, sizeof fd_set = 32
opening 1770th socket failed: Too many open files

malapert: {6} unlimit -h ; unlimit
malapert: {7} /tmp/selecttest
selecttest: nsocks = 4093, TEST_FDSETSIZE = -1, FD_SETSIZE = 256, sizeof fd_set = 32
created 4093 sockets, maxfd = 4095
FD_CLR test...OK
FD_SET test...OK
select test...OK