Messages in this thread | | | From | (Miquel van Smoorenburg) | Subject | Re: How to increat [sic.] max open files - some answers | Date | 6 Jan 1997 18:16:35 +0100 |
| |
In article <Pine.LNX.3.95.970105200741.283A-100000@nextd.demon.co.uk>, Mark Hemment <markhe@nextd.demon.co.uk> wrote: > >On 4 Jan 1997, Miquel van Smoorenburg wrote: >> posix_types.h:#undef __FD_SETSIZE >> posix_types.h:#define __FD_SETSIZE 1024 >> posix_types.h:#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS) >> time.h:#define FD_SETSIZE __FD_SETSIZE > >But what happens when 1024 is not enough, or 2048... > >Under an SVR4 derived system, when the num of open descriptors is raised >FD_SETSIZE does not magically change in the library/apps.
No, but as I said, on some systems you can just do a
#define FD_SETSIZE 4096 #include <sys/select.h>
and presto sizeof(fd_set) == 512 (4096 bits)
Just be careful not to hand file descriptors > 1024 to a library function that uses select().
Mike. -- | Miquel van Smoorenburg | "Sticky tape is like the Force - it has a | | miquels@drinkel.cistron.nl | dark side, it has a light side, and it | | ----8<--------------8<---- | holds the universe together" - Carl Zwanig |
| |