7 #if __STDC_VERSION__ >= 199901L
8 #define __restrict restrict
9 #elif !defined(__GNUC__)
15 #define __NEED_suseconds_t
16 #define __NEED_struct_timeval
17 #define __NEED_struct_timespec
18 #define __NEED_sigset_t
20 #include <bits/alltypes.h>
22 #define FD_SETSIZE 1024
24 typedef unsigned long fd_mask;
28 unsigned long fds_bits[FD_SETSIZE / 8 / sizeof(long)];
31 #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)
32 #define FD_SET(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] |= (1UL<<((d)%(8*sizeof(long)))))
33 #define FD_CLR(d, s) ((s)->fds_bits[(d)/(8*sizeof(long))] &= ~(1UL<<((d)%(8*sizeof(long)))))
34 #define FD_ISSET(d, s) !!((s)->fds_bits[(d)/(8*sizeof(long))] & (1UL<<((d)%(8*sizeof(long)))))
36 int select (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, struct timeval *__restrict);
37 int pselect (int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict, const struct timespec *__restrict, const sigset_t *__restrict);