> After even more studying of the sys/types.h header, I could see a
> MAJOR problem with the way fd_set is defined. It appears that
> this structure is defined as a wrapper around an array of bytes,
> the number of which determined by the FD_SETSIZE macro. The
> length of this is computed at COMPILE TIME.
>
> What's worse, the various macros like FD_ZERO, and friends do not
> do any sort of bounds checking. This means that when I called
> FD_SET() with a descriptor value greater than FD_SETSIZE, I was
> actually over-running a buffer. Talk about subtle!!!
>
> To fix this, I could simply #define my own value of FD_SETSIZE so
> that the size of the array is computed large enough to handle all
> the descriptors I need. (Adding a -D to my makefile).
>
> Caveat programmer...

        It is generally well known that most platforms limit 'select' to 1,024 file
descriptors unless you do something. Sadly, the platform you are using does
not support 'poll', the usual fix to this problem.

        DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to