| 1 |
gregl |
3.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 |
gregl |
3.2 |
#ifdef BSD |
| 27 |
gregl |
3.1 |
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) |
| 28 |
gregl |
3.2 |
#else |
| 29 |
|
|
#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) |
| 30 |
gregl |
3.1 |
#endif |
| 31 |
gregl |
3.3 |
#endif |