Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtexec / osdep.h
1 #ifndef OSDEP_H
2 #define OSDEP_H
3
4 /******************************************************************
5  *
6  * $XConsortium: osdep.h /main/4 1996/01/15 11:43:44 rswiston $
7  *
8  * Bitmask routines to support the usage of select() in dtexec.
9  * Revised for Spec1170 conformance.
10  *
11  */
12
13
14 #ifdef _POSIX_SOURCE
15 # include <limits.h>
16 #else
17 # define _POSIX_SOURCE
18 # include <limits.h>
19 # undef _POSIX_SOURCE
20 #endif
21
22 #include <sys/time.h>
23 #include <sys/types.h>
24 #ifndef __hpux
25 # include <sys/select.h>
26 # define FD_SET_CAST(x) (x)
27 #else
28 # define FD_SET_CAST(x) ((int *)(x))
29 #endif
30
31 #ifndef OPEN_MAX
32 # define OPEN_MAX 128
33 #endif
34
35 #if OPEN_MAX <= 128
36 # define MAXSOCKS (OPEN_MAX)
37 #else
38 # define MAXSOCKS 128
39 #endif
40
41 #define BITSET(buf, i)          FD_SET(i, &(buf))
42 #define BITCLEAR(buf, i)        FD_CLR(i, &(buf))
43 #define GETBIT(buf, i)          FD_ISSET(i, &(buf))
44 #define COPYBITS(src, dst)      (dst) = (src)
45 #define CLEARBITS(buf)          FD_ZERO(&buf)
46
47 #endif /* OSDEP_H */