1
0

select.h 779 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __SELECT_H
  2. #define __SELECT_H
  3. #ifndef _BSD_EXTENSION
  4. This header file is an extension to ANSI/POSIX
  5. #endif
  6. #pragma lib "/$M/lib/ape/libap.a"
  7. #ifndef _FD_SET_T
  8. #define _FD_SET_T
  9. /* BSD select, and adjunct types and macros */
  10. /* assume 96 fds is sufficient for fdset size */
  11. typedef struct fd_set {
  12. long fds_bits[3];
  13. } fd_set;
  14. #define FD_SET(n,p) ((p)->fds_bits[(n)>>5] |= (1 << ((n) &0x1f)))
  15. #define FD_CLR(n,p) ((p)->fds_bits[(n)>>5] &= ~(1 << ((n) &0x1f)))
  16. #define FD_ISSET(n,p) ((p)->fds_bits[(n)>>5] & (1 << ((n) &0x1f)))
  17. #define FD_ZERO(p) ((p)->fds_bits[0] =0, (p)->fds_bits[1] =0, (p)->fds_bits[2] =0)
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. extern int select(int, fd_set*, fd_set*, fd_set*, struct timeval *);
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif