From 3dd0e9853e962e2f1a45ed4e205cfa68574fadca Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Mon, 30 Sep 2024 16:04:26 +0300 Subject: [PATCH] include/sys/select.h: Define __SELECT_NUINT32 in generic way Support defining OPEN_MAX freely to allow increasing it from 256 Signed-off-by: Jukka Laitinen --- include/sys/select.h | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/include/sys/select.h b/include/sys/select.h index dcf698521a65b..542c0058d09e2 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -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 */