diff options
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/bits/select.h | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/sysdeps/generic/bits/select.h b/sysdeps/generic/bits/select.h index f886aec210..1025532afe 100644 --- a/sysdeps/generic/bits/select.h +++ b/sysdeps/generic/bits/select.h @@ -23,26 +23,13 @@ /* We don't use `memset' because this would require a prototype and the array isn't too big. */ -#ifdef __USE_XOPEN -# define __FD_ZERO(s) \ +#define __FD_ZERO(s) \ do { \ unsigned int __i; \ __fd_set *__arr = (s); \ for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ - __arr->fds_bits[__i] = '\0'; \ + __FDS_BITS (__arr)[__i] = '\0'; \ } while (0) -# define __FD_SET(d, s) ((s)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -# define __FD_CLR(d, s) ((s)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -# define __FD_ISSET(d, s) (((s)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) -#else -# define __FD_ZERO(s) \ - do { \ - unsigned int __i; \ - __fd_set *__arr = (s); \ - for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \ - __arr->__fds_bits[__i] = '\0'; \ - } while (0) -# define __FD_SET(d, s) ((s)->__fds_bits[__FDELT(d)] |= __FDMASK(d)) -# define __FD_CLR(d, s) ((s)->__fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -# define __FD_ISSET(d, s) (((s)->__fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) -#endif +#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d)) +#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d)) +#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0) |