ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/selcall.h
Revision: 3.5
Committed: Tue Feb 25 02:47:22 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 3.4: +2 -57 lines
Log Message:
Replaced inline copyright notice with #include "copyright.h"

File Contents

# User Rev Content
1 greg 3.5 /* RCSid $Id$ */
2 gregl 3.1 /*
3     * header file for select call compatibility
4 greg 3.4 */
5    
6 greg 3.5 #include "copyright.h"
7 gregl 3.1
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 gregl 3.2 #ifdef BSD
26 gregl 3.1 #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
27 gregl 3.2 #else
28     #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
29 gregl 3.1 #endif
30 gregl 3.3 #endif