PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/ntp/include/ntp_select.h

https://bitbucket.org/freebsd/freebsd-head/
C++ Header | 35 lines | 25 code | 5 blank | 5 comment | 2 complexity | a777e83a01032eb5e21bd37d56f439d5 MD5 | raw file
 1/*
 2 * Not all machines define FD_SET in sys/types.h
 3 */ 
 4#ifndef _ntp_select_h
 5#define _ntp_select_h
 6
 7/* Was: (defined(RS6000)||defined(SYS_PTX))&&!defined(_BSD) */
 8/* Could say: !defined(FD_SET) && defined(HAVE_SYS_SELECT_H) */
 9#if defined(HAVE_SYS_SELECT_H) && !defined(_BSD)
10#ifndef SYS_VXWORKS
11#include <sys/select.h>
12#else
13#include <sockLib.h>
14extern int  select P((int width, fd_set *pReadFds, fd_set *pWriteFds,
15            fd_set *pExceptFds, struct timeval *pTimeOut));
16
17#endif
18#endif
19
20#if !defined(FD_SET) && !defined(SYS_WINNT)
21#define NFDBITS         32
22#define FD_SETSIZE      32
23#define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
24#define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
25#define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
26#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
27#endif
28
29#if defined(VMS)
30typedef struct {
31    unsigned int fds_bits[1];
32} fd_set;
33#endif
34
35#endif /* _ntp_select_h */