Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / include / ntp_select.h
blobf7bba919d2b86ef72abf60fcc0d07278cf6f7f14
1 /* $NetBSD$ */
3 /*
4 * Not all machines define FD_SET in sys/types.h
5 */
6 #ifndef _ntp_select_h
7 #define _ntp_select_h
9 /* Was: (defined(RS6000)||defined(SYS_PTX))&&!defined(_BSD) */
10 /* Could say: !defined(FD_SET) && defined(HAVE_SYS_SELECT_H) */
11 #if defined(HAVE_SYS_SELECT_H) && !defined(_BSD)
12 #ifndef SYS_VXWORKS
13 #include <sys/select.h>
14 #else
15 #include <sockLib.h>
16 extern int select P((int width, fd_set *pReadFds, fd_set *pWriteFds,
17 fd_set *pExceptFds, struct timeval *pTimeOut));
19 #endif
20 #endif
22 #if !defined(FD_SET) && !defined(SYS_WINNT)
23 #define NFDBITS 32
24 #define FD_SETSIZE 32
25 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
26 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
27 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
28 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
29 #endif
31 #if defined(VMS)
32 typedef struct {
33 unsigned int fds_bits[1];
34 } fd_set;
35 #endif
37 #endif /* _ntp_select_h */