1 /* http_load - multiprocessing http test client
2 **
3 ** Copyright © 1998,1999,2001 by Jef Poskanzer <jef@mail.acme.com>.
4 ** All rights reserved.
5 **
6 ** Redistribution and use in source and binary forms, with or without
7 ** modification, are permitted provided that the following conditions
8 ** are met:
9 ** 1. Redistributions of source code must retain the above copyright
10 **    notice, this list of conditions and the following disclaimer.
11 ** 2. Redistributions in binary form must reproduce the above copyright
12 **    notice, this list of conditions and the following disclaimer in the
13 **    documentation and/or other materials provided with the distribution.
14 **
15 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 ** ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 ** SUCH DAMAGE.
26 */
27 
28 /* port.h - portability defines */
29 
30 #if defined(__FreeBSD__)
31 #define OS_FreeBSD
32 #define ARCH "FreeBSD"
33 #elif defined(__OpenBSD__)
34 #define OS_OpenBSD
35 #define ARCH "OpenBSD"
36 #elif defined(__NetBSD__)
37 #define OS_NetBSD
38 #define ARCH "NetBSD"
39 #elif defined(__DragonFly__)
40 #define OS_DragonFly
41 #define ARCH "DragonFly"
42 #elif defined(linux)
43 #define OS_Linux
44 #define ARCH "Linux"
45 #elif defined(sun)
46 #define OS_Solaris
47 #define ARCH "Solaris"
48 #elif defined(__osf__)
49 #define OS_DigitalUnix
50 #define ARCH "DigitalUnix"
51 #elif defined(__svr4__)
52 #define OS_SysV
53 #define ARCH "SysV"
54 #else
55 #define OS_UNKNOWN
56 #define ARCH "UNKNOWN"
57 #endif
58 
59 #ifdef OS_FreeBSD
60 #include <osreldate.h>
61 #define HAVE_DAEMON
62 #define HAVE_SETSID
63 #define HAVE_SETLOGIN
64 #define HAVE_WAITPID
65 #define HAVE_HSTRERROR
66 #define HAVE_TM_GMTOFF
67 #define HAVE_SENDFILE
68 #define HAVE_SCANDIR
69 #define HAVE_INT64T
70 #define HAVE_SRANDOMDEV
71 #ifdef SO_ACCEPTFILTER
72 #define HAVE_ACCEPT_FILTERS
73 #if (__FreeBSD_version >= 411000)
74 #define ACCEPT_FILTER_NAME "httpready"
75 #else
76 #define ACCEPT_FILTER_NAME "dataready"
77 #endif
78 #endif /* SO_ACCEPTFILTER */
79 #endif /* OS_FreeBSD */
80 
81 #ifdef OS_OpenBSD
82 #define HAVE_DAEMON
83 #define HAVE_SETSID
84 #define HAVE_SETLOGIN
85 #define HAVE_WAITPID
86 #define HAVE_HSTRERROR
87 #define HAVE_TM_GMTOFF
88 #define HAVE_SCANDIR
89 #define HAVE_INT64T
90 #endif /* OS_OpenBSD */
91 
92 #ifdef OS_NetBSD
93 #define HAVE_DAEMON
94 #define HAVE_SETSID
95 #define HAVE_SETLOGIN
96 #define HAVE_WAITPID
97 #define HAVE_HSTRERROR
98 #define HAVE_TM_GMTOFF
99 #define HAVE_SCANDIR
100 #define HAVE_INT64T
101 #endif /* OS_NetBSD */
102 
103 #ifdef OS_DragonFly
104 #define HAVE_DAEMON
105 #define HAVE_SETSID
106 #define HAVE_SETLOGIN
107 #define HAVE_WAITPID
108 #define HAVE_HSTRERROR
109 #define HAVE_TM_GMTOFF
110 #define HAVE_SCANDIR
111 #define HAVE_INT64T
112 #endif /* OS_DragonFly */
113 
114 #ifdef OS_Linux
115 #define HAVE_DAEMON
116 #define HAVE_SETSID
117 #define HAVE_WAITPID
118 #define HAVE_TM_GMTOFF
119 #define HAVE_SENDFILE
120 #define HAVE_LINUX_SENDFILE
121 #define HAVE_SCANDIR
122 #define HAVE_INT64T
123 #endif /* OS_Linux */
124 
125 #ifdef OS_Solaris
126 #define HAVE_SETSID
127 #define HAVE_WAITPID
128 #define HAVE_SIGSET
129 #define HAVE_INT64T
130 #endif /* OS_Solaris */
131 
132 #ifdef OS_DigitalUnix
133 #define HAVE_SETSID
134 #define HAVE_SETLOGIN
135 #define HAVE_WAITPID
136 #define HAVE_SCANDIR
137 #define HAVE_TM_GMTOFF
138 #define NO_SNPRINTF
139 /* # define HAVE_INT64T */ /* Digital Unix 4.0d doesn't have int64_t */
140 #endif                     /* OS_DigitalUnix */
141 
142 #ifdef OS_SysV
143 #define HAVE_SETSID
144 #define HAVE_WAITPID
145 #define HAVE_SIGSET
146 #endif /* OS_Solaris */
147