1 |
/* RCSid $Id$ */ |
2 |
/* |
3 |
* header file for select call compatibility |
4 |
*/ |
5 |
|
6 |
#include "copyright.h" |
7 |
|
8 |
#include <sys/types.h> |
9 |
#include <sys/time.h> |
10 |
#ifdef INCL_SEL_H |
11 |
#include <sys/select.h> |
12 |
#endif |
13 |
|
14 |
#ifndef FD_SETSIZE |
15 |
#include <sys/param.h> |
16 |
#define FD_SETSIZE NOFILE /* maximum # select file descriptors */ |
17 |
#endif |
18 |
#ifndef FD_SET |
19 |
#ifndef NFDBITS |
20 |
#define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */ |
21 |
#endif |
22 |
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) |
23 |
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) |
24 |
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) |
25 |
#ifdef BSD |
26 |
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) |
27 |
#else |
28 |
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) |
29 |
#endif |
30 |
#endif |