File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / include / ntp_select.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 5 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

/*
 * Not all machines define FD_SET in sys/types.h
 */ 
#ifndef NTP_SELECT_H
#define NTP_SELECT_H

/* Was: (defined(RS6000)||defined(SYS_PTX))&&!defined(_BSD) */
/* Could say: !defined(FD_SET) && defined(HAVE_SYS_SELECT_H) */
#if defined(HAVE_SYS_SELECT_H) && !defined(_BSD)
#ifndef SYS_VXWORKS
#include <sys/select.h>
#else
#include <sockLib.h>
extern int  select (int width, fd_set *pReadFds, fd_set *pWriteFds,
		    fd_set *pExceptFds, struct timeval *pTimeOut);

#endif
#endif

#if !defined(FD_SET)
#define NFDBITS         32
#define FD_SETSIZE      32
#define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p)      memset((char *)(p), 0, sizeof(*(p)))
#endif

#if defined(VMS)
typedef struct {
    unsigned int fds_bits[1];
} fd_set;
#endif

#ifdef SYS_WINNT
/* ports/winnt/libntp/setpriority.c */
extern	void	InitSockets(void);
#endif

#endif	/* NTP_SELECT_H */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>