11 #define __NEED_suseconds_t
12 #define __NEED_struct_timeval
13 #define __NEED_struct_timespec
14 #define __NEED_sigset_t
16 #include <bits/alltypes.h>
18 #define FD_SETSIZE 1024
20 typedef unsigned long fd_mask
;
23 unsigned long fds_bits
[FD_SETSIZE
/ 8 / sizeof(long)];
26 #define FD_ZERO(s) do { int __i; unsigned long *__b=(s)->fds_bits; for(__i=sizeof (fd_set)/sizeof (long); __i; __i--) *__b++=0; } while(0)
27 #define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long)))))
28 #define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long)))))
29 #define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))
31 int select (int, fd_set
*__restrict
, fd_set
*__restrict
, fd_set
*__restrict
, struct timeval
*__restrict
);
32 int pselect (int, fd_set
*__restrict
, fd_set
*__restrict
, fd_set
*__restrict
, const struct timespec
*__restrict
, const sigset_t
*__restrict
);
34 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
35 #define NFDBITS (8*(int)sizeof(long))