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

# User Rev Content
1 schorsch 3.6 /* RCSid $Id: selcall.h,v 3.5 2003/02/25 02:47:22 greg Exp $ */
2 gregl 3.1 /*
3     * header file for select call compatibility
4 greg 3.4 */
5 schorsch 3.6 #ifndef _RAD_SELCALL_H_
6     #define _RAD_SELCALL_H_
7     #ifdef __cplusplus
8     extern "C" {
9     #endif
10 greg 3.4
11 greg 3.5 #include "copyright.h"
12 gregl 3.1
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 gregl 3.2 #ifdef BSD
31 gregl 3.1 #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
32 gregl 3.2 #else
33     #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
34 gregl 3.1 #endif
35 gregl 3.3 #endif
36 schorsch 3.6
37    
38     #ifdef __cplusplus
39     }
40     #endif
41     #endif /* _RAD_SELCALL_H_ */