Skip to content

Commit

Permalink
include/sys/select.h: Define __SELECT_NUINT32 in generic way
Browse files Browse the repository at this point in the history
Support defining OPEN_MAX freely to allow increasing it from 256

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Oct 1, 2024
1 parent 233c167 commit 3dd0e98
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions include/sys/select.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,7 @@
* many uint32_t's do we need to span all descriptors?
*/

#if FD_SETSIZE <= 32
# define __SELECT_NUINT32 1
#elif FD_SETSIZE <= 64
# define __SELECT_NUINT32 2
#elif FD_SETSIZE <= 96
# define __SELECT_NUINT32 3
#elif FD_SETSIZE <= 128
# define __SELECT_NUINT32 4
#elif FD_SETSIZE <= 160
# define __SELECT_NUINT32 5
#elif FD_SETSIZE <= 192
# define __SELECT_NUINT32 6
#elif FD_SETSIZE <= 224
# define __SELECT_NUINT32 7
#elif FD_SETSIZE <= 256
# define __SELECT_NUINT32 8
#else
# warning "Larger fd_set needed"
#endif
#define __SELECT_NUINT32 ((FD_SETSIZE + 31) / 32)

/* These macros map a file descriptor to an index and bit number */

Expand Down

0 comments on commit 3dd0e98

Please sign in to comment.