ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/selcall.h
Revision: 3.6
Committed: Fri Jun 6 16:38:47 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.5: +12 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 /* RCSid $Id: selcall.h,v 3.5 2003/02/25 02:47:22 greg Exp $ */
2 /*
3 * header file for select call compatibility
4 */
5 #ifndef _RAD_SELCALL_H_
6 #define _RAD_SELCALL_H_
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 #include "copyright.h"
12
13 #include <sys/types.h>
14 #include <sys/time.h>
15 #ifdef INCL_SEL_H
16 #include <sys/select.h>
17 #endif
18
19 #ifndef FD_SETSIZE
20 #include <sys/param.h>
21 #define FD_SETSIZE NOFILE /* maximum # select file descriptors */
22 #endif
23 #ifndef FD_SET
24 #ifndef NFDBITS
25 #define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */
26 #endif
27 #define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
28 #define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
29 #define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
30 #ifdef BSD
31 #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
32 #else
33 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
34 #endif
35 #endif
36
37
38 #ifdef __cplusplus
39 }
40 #endif
41 #endif /* _RAD_SELCALL_H_ */