3 ms·
I really think that this is a quality of implementation issue. Even though most implementations do so, there is no requirement to implement fd_set as a bitmap.
by EdSchouten 3y ago
I really think that this is a quality of implementation issue.
Even though most implementations do so, there is no requirement to implement fd_set as a bitmap. It could also be an array of integers. Though this still won’t allow you to select() against an infinite number of file descriptors, it at least allows file descriptor numbers to span the full range of int.
Furthermore, there’s also no requirement that FD_*() corrupt your memory. I get it that these macros can’t return errors back to the caller, but they can always set some kind of flag in the fd_set to indicate that insertion was unsuccessful. select() could check that flag and bail out if set.