1 |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
|
3 |
/* SCCSid "$SunId$ SGI" */ |
4 |
|
5 |
/* |
6 |
* header file for select call compatibility |
7 |
*/ |
8 |
|
9 |
#include <sys/types.h> |
10 |
#include <sys/time.h> |
11 |
#ifdef INCL_SEL_H |
12 |
#include <sys/select.h> |
13 |
#endif |
14 |
|
15 |
#ifndef FD_SETSIZE |
16 |
#include <sys/param.h> |
17 |
#define FD_SETSIZE NOFILE /* maximum # select file descriptors */ |
18 |
#endif |
19 |
#ifndef FD_SET |
20 |
#ifndef NFDBITS |
21 |
#define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */ |
22 |
#endif |
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 |
#ifndef BSD |
27 |
#define bzero(d,n) memset(d,0,n) |
28 |
#endif |
29 |
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) |
30 |
#endif |