src/server/systems.h

changeset 14
b8bf95b39952
parent 13
1fdbf4170ef4
child 15
cff9c4101dd7
equal deleted inserted replaced
13:1fdbf4170ef4 14:b8bf95b39952
1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 *
4 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5 *
6 * THE BSD LICENSE
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * Redistributions of source code must retain the above copyright notice, this
12 * list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * Neither the name of the nor the names of its contributors may be
18 * used to endorse or promote products derived from this software without
19 * specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef BASE_SYSTEMS_H
35 #define BASE_SYSTEMS_H
36
37 #include <nspr.h>
38
39 #ifndef NOINTNSAPI
40 #define INTNSAPI
41 #endif /* !NOINTNSAPI */
42
43 /*
44 * systems.h: Lists of defines for systems
45 *
46 * This sets what general flavor the system is (UNIX, etc.),
47 * and defines what extra functions your particular system needs.
48 */
49
50
51 /* --- Begin common definitions for all supported platforms --- */
52
53 #define DAEMON_ANY
54 #define DAEMON_STATS
55
56 /* --- End common definitions for all supported platforms --- */
57
58 /* --- Begin platform-specific definitions --- */
59
60 #if defined(AIX)
61
62 #define HAS_IPV6
63 #define AUTH_DBM
64 #define BSD_RLIMIT
65 #undef BSD_SIGNALS
66 //define DAEMON_NEEDS_SEMAPHORE
67 //define DAEMON_UNIX_MOBRULE
68 //define DLL_CAPABLE
69 #define DLL_DLOPEN
70 #define DLL_DLOPEN_FLAGS RTLD_NOW|RTLD_GLOBAL
71 #define DNS_CACHE
72 #define FILE_INHERIT_FCNTL
73 #define FILE_MMAP_FLAGS MAP_SHARED
74 #define HAS_STATFS
75 #define HAVE_ATEXIT
76 #define HAVE_STRERROR_R
77 #define HAVE_STRTOK_R
78 #define HAVE_TIME_R 2 /* arg count */
79 #define HAVE_STRFTIME /* no cftime */
80 #define JAVA_STATIC_LINK
81 #undef NEED_CRYPT_H
82 #define NEED_STRINGS_H /* for strcasecmp */
83 #define NET_SOCKETS
84 #define SA_HANDLER_T(x) (void (*)(int))x
85 #ifdef NS_OLDES3X
86 #define SA_NOCLDWAIT 0 /* AIX don't got this */
87 #endif
88 #define SEM_FLOCK
89 #define SHMEM_MMAP_FLAGS MAP_SHARED
90 #ifdef HW_THREADS
91 #define THREAD_ANY
92 #endif
93 #elif defined(BSDI)
94
95 #define AUTH_DBM
96 #define BSD_MAIL
97 #define BSD_RLIMIT
98 #define BSD_SIGNALS
99 #define BSD_TIME
100 #define DAEMON_UNIX_MOBRULE
101 #define DNS_CACHE
102 #define FILE_INHERIT_FCNTL
103 #define FILE_MMAP_FLAGS (MAP_FILE | MAP_SHARED)
104 #define HAS_STATFS
105 #define HAVE_ATEXIT
106 #undef NEED_CRYPT_PROTO
107 #define NET_SOCKETS
108 #define NO_DOMAINNAME
109 #define SEM_FLOCK
110 #define SHMEM_MMAP_FLAGS MAP_SHARED
111 #define JAVA_STATIC_LINK
112
113 #elif defined(HPUX)
114
115 #define HAVE_TIME_R 2 /* arg count */
116 #define AUTH_DBM
117 #undef BSD_RLIMIT
118 #undef BSD_SIGNALS
119 #ifdef MCC_PROXY
120 #define DAEMON_NEEDS_SEMAPHORE
121 #else
122 #define DAEMON_NEEDS_SEMAPHORE
123 #endif
124 #define DAEMON_UNIX_MOBRULE
125 #define DLL_CAPABLE
126 #define DLL_HPSHL
127 #define DNS_CACHE
128 #define FILE_INHERIT_FCNTL
129 #define FILE_MMAP_FLAGS MAP_PRIVATE
130 #define HAS_STATFS
131 #define HAVE_ATEXIT
132 #define HAVE_STRFTIME
133 #define JAVA_STATIC_LINK
134 #undef NEED_CRYPT_H
135 #define NET_SOCKETS
136 #define SA_HANDLER_T(x) (void (*)(int))x
137 #define SEM_FLOCK
138 /* warning: mmap doesn't work under 9.04 */
139 #define SHMEM_MMAP_FLAGS MAP_FILE | MAP_VARIABLE | MAP_SHARED
140
141 #elif defined (IRIX)
142
143 #define AUTH_DBM
144 #define BSD_RLIMIT
145 #undef BSD_SIGNALS
146 #define DAEMON_UNIX_MOBRULE
147 #define DLL_CAPABLE
148 #define DLL_DLOPEN
149 #define DLL_DLOPEN_FLAGS RTLD_NOW
150 #define DNS_CACHE
151 #define FILE_INHERIT_FCNTL
152 #define FILE_MMAP_FLAGS MAP_SHARED
153 #define HAS_STATVFS
154 #define HAVE_ATEXIT
155 #define HAVE_STRTOK_R
156 #define HAVE_TIME_R 2 /* arg count */
157 #define JAVA_STATIC_LINK
158 #define NEED_CRYPT_H
159 #define NET_SOCKETS
160 #define SA_HANDLER_T(x) (void (*)(int))x
161 #define SEM_FLOCK
162 #define SHMEM_MMAP_FLAGS MAP_SHARED
163 #define THROW_HACK throw()
164
165 #elif defined(Linux)
166
167 #define HAS_IPV6
168 #define AUTH_DBM
169 #define BSD_RLIMIT
170 #undef BSD_SIGNALS
171 #define DAEMON_NEEDS_SEMAPHORE
172 #define DAEMON_UNIX_MOBRULE
173 #define DLL_CAPABLE
174 #define DLL_DLOPEN
175 #define DLL_DLOPEN_FLAGS RTLD_NOW
176 #define DNS_CACHE
177 #define FILE_INHERIT_FCNTL
178 #define FILE_MMAP_FLAGS MAP_SHARED
179 #define SEM_FLOCK
180 #define SHMEM_MMAP_FLAGS MAP_SHARED
181 #define HAS_STATVFS
182 #define HAVE_ATEXIT
183 #define HAVE_STRTOK_R
184 #define HAVE_TIME_R 2 /* arg count */
185 #define NEED_CRYPT_H
186 #undef NEED_FILIO
187 #define NEED_GHN_PROTO
188 #define NET_SOCKETS
189 #define SA_HANDLER_T(x) (void (*)(int))x
190 #undef NEED_GHN_PROTO
191
192 #elif defined(NCR)
193
194 #define AUTH_DBM
195 #undef BSD_RLIMIT
196 /* #define DAEMON_NEEDS_SEMAPHORE */
197 #define DAEMON_UNIX_MOBRULE
198 #define DLL_CAPABLE
199 #define DLL_DLOPEN
200 #define DLL_DLOPEN_FLAGS RTLD_NOW
201 #define DNS_CACHE
202 #define FILE_INHERIT_FCNTL
203 #define FILE_MMAP_FLAGS MAP_SHARED
204 #define HAS_STATVFS
205 #define HAVE_ATEXIT
206 #define HAVE_STRTOK_R
207 #define JAVA_STATIC_LINK
208 #define NEED_CRYPT_H
209 #define NEED_FILIO
210 #define NEED_GHN_PROTO
211 #define NET_SOCKETS
212 #define SEM_FLOCK
213 #define SHMEM_MMAP_FLAGS MAP_SHARED
214
215 #elif defined(NEC)
216
217 #define DNS_CACHE
218 #define AUTH_DBM
219 #undef BSD_RLIMIT
220 #define DAEMON_NEEDS_SEMAPHORE
221 #define DAEMON_UNIX_MOBRULE
222 #define DLL_DLOPEN
223 #define DLL_DLOPEN_FLAGS RTLD_NOW
224 #define DLL_CAPABLE
225 #define FILE_INHERIT_FCNTL
226 #define FILE_MMAP_FLAGS MAP_SHARED
227 #define HAS_STATVFS
228 #define HAVE_ATEXIT
229 #define HAVE_STRTOK_R
230 #define HAVE_TIME_R 2 /* arg count */
231 #define JAVA_STATIC_LINK
232 #define NEED_CRYPT_H
233 #define NEED_FILIO
234 #define NET_SOCKETS
235 #define SEM_FLOCK
236 #define SHMEM_MMAP_FLAGS MAP_SHARED
237
238 #elif defined(OSF1)
239
240 #define HAS_IPV6
241 #define AUTH_DBM
242 #define BSD_RLIMIT
243 #undef BSD_SIGNALS
244 #define BSD_TIME
245 #define DAEMON_UNIX_MOBRULE
246 #define DAEMON_NEEDS_SEMAPHORE
247 #define DLL_CAPABLE
248 #define DLL_DLOPEN
249 #define DLL_DLOPEN_FLAGS RTLD_NOW
250 #define DNS_CACHE
251 #define FILE_INHERIT_FCNTL
252 #define FILE_MMAP_FLAGS MAP_SHARED
253 #define HAVE_ATEXIT
254 #define HAVE_STRFTIME /* no cftime */
255 #define HAVE_TIME_R 2 /* ctime_r arg count */
256 #define NET_SOCKETS
257 #define SA_HANDLER_T(x) (void (*)(int))x
258 #define SEM_FLOCK
259 #define SHMEM_MMAP_FLAGS MAP_SHARED
260
261 #elif defined(SCO)
262
263 #define AUTH_DBM
264 #undef BSD_RLIMIT
265 #undef BSD_SIGNALS
266 #define DAEMON_NEEDS_SEMAPHORE
267 #define DAEMON_UNIX_MOBRULE
268 #define DLL_CAPABLE
269 #define DLL_DLOPEN
270 #define DLL_DLOPEN_FLAGS RTLD_NOW
271 #define DNS_CACHE
272 #define FILE_INHERIT_FCNTL
273 #define FILE_MMAP_FLAGS MAP_SHARED
274 #define HAS_STATVFS
275 #define HAVE_ATEXIT
276 #undef NEED_CRYPT_H
277 #undef NEED_FILIO
278 #undef NEED_GHN_PROTO
279 #undef NEED_SETEID_PROTO /* setegid, seteuid */
280 #define NET_SOCKETS
281 #define SEM_FLOCK
282 #define SHMEM_MMAP_FLAGS MAP_SHARED
283 #define SA_HANDLER_T(x) (void (*)(int))x
284
285
286 #elif defined(SNI)
287
288 #define AUTH_DBM
289 #undef BSD_RLIMIT
290 #define DAEMON_NEEDS_SEMAPHORE
291 #define DAEMON_UNIX_MOBRULE
292 #define DLL_CAPABLE
293 #define DLL_DLOPEN
294 #define DLL_DLOPEN_FLAGS RTLD_NOW
295 #define DNS_CACHE
296 #define FILE_INHERIT_FCNTL
297 #define FILE_MMAP_FLAGS MAP_SHARED
298 #define HAS_STATVFS
299 #define HAVE_ATEXIT
300 #define JAVA_STATIC_LINK
301 #define NEED_CRYPT_H
302 #define NEED_FILIO
303 #define NET_SOCKETS
304 #define SEM_FLOCK
305 #define SHMEM_MMAP_FLAGS MAP_SHARED
306 #define USE_PIPE
307
308 #elif defined(SOLARIS)
309
310 #if defined(ENABLE_IPV6)
311 #define HAS_IPV6
312 #endif
313 #define AUTH_DBM
314 #define BSD_RLIMIT
315 #undef BSD_SIGNALS
316 #define DAEMON_NEEDS_SEMAPHORE
317 #define DAEMON_UNIX_MOBRULE
318 #define DLL_CAPABLE
319 #define DLL_DLOPEN
320 #define DLL_DLOPEN_FLAGS RTLD_NOW|RTLD_FIRST
321 #define DNS_CACHE
322 #define FILE_INHERIT_FCNTL
323 #define FILE_MMAP_FLAGS MAP_SHARED
324 #define HAS_STATVFS
325 #define HAVE_ATEXIT
326 #define HAVE_STRTOK_R
327 #define HAVE_TIME_R 3 /* arg count */
328 #define NEED_CRYPT_H
329 #define NEED_FILIO
330 #define NEED_GHN_PROTO
331 #define NET_SOCKETS
332 #if OSVERSION > 504
333 #define SA_HANDLER_T(x) x
334 #endif
335 #if OSVERSION >= 506
336 #undef NEED_GHN_PROTO
337 #endif
338 #define SEM_FLOCK
339 #define SHMEM_MMAP_FLAGS MAP_SHARED
340
341 #elif defined (SONY)
342
343 #define AUTH_DBM
344 #undef BSD_RLIMIT
345 #define DAEMON_NEEDS_SEMAPHORE
346 #define DAEMON_UNIX_MOBRULE
347 #define DLL_CAPABLE
348 #define FILE_INHERIT_FCNTL
349 #define FILE_MMAP_FLAGS MAP_SHARED
350 #define HAVE_ATEXIT
351 #define NEED_CRYPT_H
352 #define NEED_FILIO
353 #define NET_SOCKETS
354 #define SEM_FLOCK
355 #define SHMEM_MMAP_FLAGS MAP_SHARED
356
357 #elif defined(SUNOS4)
358
359 #define AUTH_DBM
360 #define BSD_MAIL
361 #define BSD_RLIMIT
362 #define BSD_SIGNALS
363 #define BSD_TIME
364 #define DAEMON_UNIX_MOBRULE
365 #define DLL_CAPABLE
366 #define DLL_DLOPEN
367 #define DLL_DLOPEN_FLAGS 1
368 #define DNS_CACHE
369 #define FILE_INHERIT_FCNTL
370 #define FILE_MMAP_FLAGS MAP_SHARED
371 #define HAS_STATFS
372 #undef HAVE_ATEXIT
373 #undef NEED_CRYPT_H
374 #define NEED_CRYPT_PROTO
375 #define NEED_FILIO
376 #define NET_SOCKETS
377 #define SEM_FLOCK
378 #define SHMEM_MMAP_FLAGS MAP_SHARED
379
380 #elif defined(UNIXWARE)
381
382 #define AUTH_DBM
383 #undef BSD_RLIMIT
384 #define DAEMON_UNIX_MOBRULE
385 #define DLL_CAPABLE
386 #define DLL_DLOPEN
387 #define DLL_DLOPEN_FLAGS RTLD_NOW
388 #define DNS_CACHE
389 #define FILE_INHERIT_FCNTL
390 #define FILE_MMAP_FLAGS MAP_SHARED
391 #define HAS_STATVFS
392 #define HAVE_ATEXIT
393 #define NEED_CRYPT_H
394 #define NEED_FILIO
395 #define NEED_GHN_PROTO
396 #define NEED_SETEID_PROTO /* setegid, seteuid */
397 #define NET_SOCKETS
398 #define SEM_FLOCK
399 #define SHMEM_MMAP_FLAGS MAP_SHARED
400
401 #ifndef boolean
402 #define boolean boolean
403 #endif
404
405 #elif defined (XP_WIN32) /* Windows NT */
406
407 #include <wtypes.h>
408 #include <winbase.h>
409
410 #define AUTH_DBM
411 #define DAEMON_WIN32
412 #define DLL_CAPABLE
413 #define DLL_WIN32
414 #define DNS_CACHE
415 #define LOG_BUFFERING
416 #define HAVE_STRFTIME /* no cftime */
417 #define NEED_CRYPT_PROTO
418 #define NEEDS_WRITEV
419 #define NET_SOCKETS
420 #define NO_DOMAINNAME
421 #ifdef BUILD_DLL
422 #if defined (NSAPI_PUBLIC)
423 #undef NSAPI_PUBLIC
424 #endif
425 #define NSAPI_PUBLIC __declspec(dllexport)
426 #else
427 #if defined (NSAPI_PUBLIC)
428 #undef NSAPI_PUBLIC
429 #endif
430 #define NSAPI_PUBLIC
431 #endif /* BUILD_DLL */
432 #define SEM_WIN32
433 #define THREAD_ANY
434 #define THREAD_NSPR_KERNEL
435 #define USE_NSPR
436 #define USE_STRFTIME /* no cftime */
437 #define FILE_DEV_NULL "\\\\.\NUL"
438
439 #endif /* Windows NT */
440
441 /* --- Begin defaults for values not defined above --- */
442
443 #ifndef DAEMON_LISTEN_SIZE
444 #define DAEMON_LISTEN_SIZE 128
445 #endif /* !DAEMON_LISTEN_SIZE */
446
447 #ifndef NSAPI_PUBLIC
448 #define NSAPI_PUBLIC
449 #endif
450
451 #ifndef SA_HANDLER_T
452 #define SA_HANDLER_T(x) (void (*)())x
453 #endif
454
455 #ifndef THROW_HACK
456 #define THROW_HACK /* as nothing */
457 #endif
458
459 #ifndef FILE_DEV_NULL
460 #define FILE_DEV_NULL "/dev/null"
461 #endif
462
463 /* --- End defaults for values not defined above --- */
464
465 /* --- Begin the great debate --- */
466
467 /* NS_MAIL builds sec-key.c which calls systhread_init, which requires */
468 /* that USE_NSPR is defined when systhr.c is compiled. --lachman */
469 /* MCC_PROXY does the same thing now --nbreslow -- LIKE HELL --ari */
470 #if (defined(MCC_HTTPD) || defined(MCC_ADMSERV) || defined(MCC_PROXY) || defined(NS_MAIL)) && defined(XP_UNIX)
471 #define USE_NSPR
472 /* XXXrobm This is UNIX-only for the moment */
473 #define LOG_BUFFERING
474 #ifdef SW_THREADS
475 #define THREAD_NSPR_USER
476 #else
477 #define THREAD_NSPR_KERNEL
478 #endif
479 #define THREAD_ANY
480 #endif
481
482 /* --- End the great debate --- */
483
484 #ifndef APSTUDIO_READONLY_SYMBOLS
485
486 #ifndef NSPR_PRIO_H
487 //include "prio.h"
488 #define NSPR_PRIO_H
489 #endif /* !NSPR_PRIO_H */
490
491 /*
492 * These types have to be defined early, because they are defined
493 * as (void *) in the public API.
494 */
495
496 #ifndef SYS_FILE_T
497 typedef PRFileDesc *SYS_FILE;
498 #define SYS_FILE_T PRFileDesc *
499 #endif /* !SYS_FILE_T */
500
501 #ifndef SYS_NETFD_T
502 typedef PRFileDesc *SYS_NETFD;
503 #define SYS_NETFD_T PRFileDesc *
504 #endif /* !SYS_NETFD_T */
505
506 #ifdef SEM_WIN32
507
508 typedef HANDLE SEMAPHORE;
509 #define SEMAPHORE_T HANDLE
510 #define SEM_ERROR NULL
511 /* That oughta hold them (I hope) */
512 #define SEM_MAXVALUE 32767
513
514 #elif defined(SEM_FLOCK)
515
516 //define SEMAPHORE_T int
517 //typedef int SEMAPHORE;
518 //define SEM_ERROR -1
519
520 #elif defined(SEM_POSIX)
521
522 #define SEM_ERROR ((void *)(-1))
523 typedef void* SEMAPHORE_T;
524
525 #else /* ! SEM_WIN32 */
526
527 typedef int SEMAPHORE;
528 #define SEMAPHORE_T int
529 #define SEM_ERROR -1
530
531 #endif /* SEM_WIN32 */
532
533 #endif /* !APSTUDIO_READONLY_SYMBOLS */
534
535 #ifndef XP_CPLUSPLUS
536 #ifdef __cplusplus
537 #define XP_CPLUSPLUS
538 #endif /* __cplusplus */
539 #endif /* !XP_CPLUSPLUS */
540
541 #endif /* BASE_SYSTEMS_H */

mercurial