Annotation of win32/apache13/src/include/ap_config.h, revision 1.1.1.1
1.1 parser 1: /* ====================================================================
2: * Copyright (c) 1995-1999 The Apache Group. All rights reserved.
3: *
4: * Redistribution and use in source and binary forms, with or without
5: * modification, are permitted provided that the following conditions
6: * are met:
7: *
8: * 1. Redistributions of source code must retain the above copyright
9: * notice, this list of conditions and the following disclaimer.
10: *
11: * 2. Redistributions in binary form must reproduce the above copyright
12: * notice, this list of conditions and the following disclaimer in
13: * the documentation and/or other materials provided with the
14: * distribution.
15: *
16: * 3. All advertising materials mentioning features or use of this
17: * software must display the following acknowledgment:
18: * "This product includes software developed by the Apache Group
19: * for use in the Apache HTTP server project (http://www.apache.org/)."
20: *
21: * 4. The names "Apache Server" and "Apache Group" must not be used to
22: * endorse or promote products derived from this software without
23: * prior written permission. For written permission, please contact
24: * apache@apache.org.
25: *
26: * 5. Products derived from this software may not be called "Apache"
27: * nor may "Apache" appear in their names without prior written
28: * permission of the Apache Group.
29: *
30: * 6. Redistributions of any form whatsoever must retain the following
31: * acknowledgment:
32: * "This product includes software developed by the Apache Group
33: * for use in the Apache HTTP server project (http://www.apache.org/)."
34: *
35: * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
36: * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
39: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
44: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
46: * OF THE POSSIBILITY OF SUCH DAMAGE.
47: * ====================================================================
48: *
49: * This software consists of voluntary contributions made by many
50: * individuals on behalf of the Apache Group and was originally based
51: * on public domain software written at the National Center for
52: * Supercomputing Applications, University of Illinois, Urbana-Champaign.
53: * For more information on the Apache Group and the Apache HTTP server
54: * project, please see <http://www.apache.org/>.
55: *
56: */
57:
58: #ifndef AP_CONFIG_H
59: #define AP_CONFIG_H
60:
61: #ifdef __cplusplus
62: extern "C" {
63: #endif
64:
65: /*
66: * ap_config.h: system-dependant #defines and includes...
67: * See PORTING for a listing of what they mean
68: */
69:
70: #include "ap_mmn.h" /* MODULE_MAGIC_NUMBER_ */
71:
72: /*
73: * Support for platform dependent autogenerated defines
74: */
75: #if !defined(WIN32) && !defined(NETWARE)
76: #include "ap_config_auto.h"
77: #else
78: /* not available under WIN32, so provide important entries manually */
79: #undef HAVE_UNISTD_H
80: #endif
81:
82: /* Have to include sys/stat.h before ../os/win32/os.h so we can override
83: stat() properly */
84: #ifndef NETWARE
85: #include <sys/types.h>
86: #endif
87: #include <sys/stat.h>
88:
89:
90: /* So that we can use inline on some critical functions, and use
91: * GNUC attributes (such as to get -Wall warnings for printf-like
92: * functions). Only do this in gcc 2.7 or later ... it may work
93: * on earlier stuff, but why chance it.
94: *
95: * We've since discovered that the gcc shipped with NeXT systems
96: * as "cc" is completely broken. It claims to be __GNUC__ and so
97: * on, but it doesn't implement half of the things that __GNUC__
98: * means. In particular it's missing inline and the __attribute__
99: * stuff. So we hack around it. PR#1613. -djg
100: */
101: #if !defined(__GNUC__) || __GNUC__ < 2 || \
102: (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
103: defined(NEXT)
104: #define ap_inline
105: #define __attribute__(__x)
106: #define ENUM_BITFIELD(e,n,w) signed int n : w
107: #else
108: #define ap_inline __inline__
109: #define USE_GNU_INLINE
110: #define ENUM_BITFIELD(e,n,w) e n : w
111: #endif
112:
113: #ifdef WIN32
114: #include "../os/win32/os.h"
115: #else
116: #include "os.h"
117: #endif
118:
119: /* Define one of these according to your system. */
120: #if defined(MINT)
121: typedef int rlim_t;
122: #define JMP_BUF sigjmp_buf
123: #define NO_LONG_DOUBLE
124: #define USE_FLOCK_SERIALIZED_ACCEPT
125: #define _BSD_SOURCE
126: #define EAGAIN EWOULDBLOCK
127: int initgroups (char *, int);
128: char *crypt (const char *pw, const char *salt);
129: int gethostname (char *name, int namelen);
130:
131: #elif defined(MPE)
132: #include <sys/times.h>
133: #define NO_SETSID
134: #define NO_KILLPG
135: #define NO_WRITEV
136: #define HAVE_SHMGET 1
137: #define USE_SHMGET_SCOREBOARD
138: /*
139: UID/GID isn't a native concept for MPE, and it's definitely not a 100%
140: Unix implementation. There isn't a traditional superuser concept either,
141: so we're forced to liberalize SHM security a bit so the parent & children
142: can communicate when they're running with different UIDs within the same
143: GID (the GID will *always* be the same on MPE). Thus the weird SHM_R and
144: SHM_W below.
145: */
146: #define SHM_R 0440 /* Read permission */
147: #define SHM_W 0220 /* Write permission */
148: #define NEED_INITGROUPS
149: #define NEED_STRCASECMP
150: #define NEED_STRDUP
151: #define NEED_STRNCASECMP
152: extern void GETPRIVMODE();
153: extern void GETUSERMODE();
154: extern char *inet_ntoa();
155: #define NO_SLACK
156: #define S_IEXEC S_IXUSR
157: #define S_IREAD S_IRUSR
158: #define S_IWRITE S_IWUSR
159: #define PF_INET AF_INET
160: #define USE_FCNTL_SERIALIZED_ACCEPT
161:
162: #elif defined(SUNOS4)
163: #define HAVE_GMTOFF 1
164: #undef NO_KILLPG
165: #undef NO_SETSID
166: char *crypt(const char *pw, const char *salt);
167: char *mktemp(char *);
168: #define HAVE_MMAP 1
169: #define USE_MMAP_SCOREBOARD
170: #define USE_MMAP_FILES
171: #include <sys/time.h>
172: #define NEED_STRERROR
173: typedef int rlim_t;
174: #define memmove(a,b,c) bcopy(b,a,c)
175: #define NO_LINGCLOSE
176: #define USE_FLOCK_SERIALIZED_ACCEPT
177: #define NEED_DIFFTIME
178: #define HAVE_SYSLOG 1
179:
180: #elif defined(SOLARIS2)
181: #undef HAVE_GMTOFF
182: #define NO_KILLPG
183: #undef NO_SETSID
184: #define bzero(a,b) memset(a,0,b)
185: #if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
186: !defined(USE_PTHREAD_SERIALIZED_ACCEPT)
187: #define USE_FCNTL_SERIALIZED_ACCEPT
188: #endif
189: #define NEED_UNION_SEMUN
190: #define HAVE_MMAP 1
191: #define USE_MMAP_SCOREBOARD
192: #define USE_MMAP_FILES
193: int gethostname(char *name, int namelen);
194: #define HAVE_SYSLOG 1
195: #define SYS_SIGLIST _sys_siglist
196:
197: #elif defined(IRIX)
198: #undef HAVE_GMTOFF
199: /* IRIX has killpg, but it's only in _BSD_COMPAT, so don't use it in case
200: * there's some weird conflict with non-BSD signals */
201: #define NO_KILLPG
202: #undef NO_SETSID
203: #if !defined(USE_FLOCK_SERIALIZED_ACCEPT) && \
204: !defined(USE_USLOCK_SERIALIZED_ACCEPT) && \
205: !defined(USE_SYSVSEM_SERIALIZED_ACCEPT)
206: #define USE_FCNTL_SERIALIZED_ACCEPT
207: #endif
208: #define HAVE_SHMGET 1
209: #define USE_SHMGET_SCOREBOARD
210: #define HAVE_MMAP 1
211: #define USE_MMAP_FILES
212: #define NO_LONG_DOUBLE
213: #define NO_LINGCLOSE
214: #define HAVE_SYSLOG 1
215:
216: #elif defined(HIUX)
217: #undef HAVE_GMTOFF
218: #define NO_KILLPG
219: #undef NO_SETSID
220: #ifndef _HIUX_SOURCE
221: #define _HIUX_SOURCE
222: #endif
223: #define HAVE_SHMGET 1
224: #define USE_SHMGET_SCOREBOARD
225: #define SELECT_NEEDS_CAST
226: #define HAVE_SYSLOG 1
227:
228: #elif defined(HPUX) || defined(HPUX10)
229: #undef HAVE_GMTOFF
230: #define NO_KILLPG
231: #undef NO_SETSID
232: #define USE_FCNTL_SERIALIZED_ACCEPT
233: #ifndef _HPUX_SOURCE
234: #define _HPUX_SOURCE
235: #endif
236: #define HAVE_SHMGET 1
237: #define USE_SHMGET_SCOREBOARD
238: #define HAVE_SYSLOG 1
239: #ifndef HPUX10
240: #define SELECT_NEEDS_CAST
241: typedef int rlim_t;
242: #endif
243:
244: #elif defined(HPUX11)
245: #ifndef _HPUX_SOURCE
246: #define _HPUX_SOURCE
247: #endif
248: #define HAVE_SHMGET
249: #define USE_SHMGET_SCOREBOARD
250: #undef HAVE_GMTOFF
251: #define USE_FCNTL_SERIALIZED_ACCEPT
252: /* feeling brave? want to try using POSIX mutexes? */
253: /* #define HAVE_MMAP */
254: /* #define USE_MMAP_SCOREBOARD */
255: /* #define USE_MMAP_FILES */
256: /* #define USE_PTHREAD_SERIALIZED_ACCEPT */
257: #define NO_KILLPG
258: #undef NO_SETSID
259: #define HAVE_SYSLOG
260:
261: #elif defined(AIX)
262: #undef HAVE_GMTOFF
263: #undef NO_KILLPG
264: #undef NO_SETSID
265: #ifndef __ps2__
266: #define HAVE_MMAP 1
267: #define USE_MMAP_SCOREBOARD
268: #define USE_MMAP_FILES
269: #define HAVE_SYSLOG 1
270: #ifndef DEFAULT_GROUP
271: #define DEFAULT_GROUP "nobody"
272: #endif
273: #endif
274: #ifndef DEFAULT_USER
275: #define DEFAULT_USER "nobody"
276: #endif
277: #ifdef NEED_RLIM_T
278: typedef int rlim_t;
279: #endif
280: #if !defined(USE_PTHREAD_SERIALIZED_ACCEPT)
281: #define USE_FCNTL_SERIALIZED_ACCEPT
282: #endif
283: #ifdef USEBCOPY
284: #define memmove(a,b,c) bcopy(b,a,c)
285: #endif
286: #if AIX >= 42
287: #define NET_SIZE_T size_t
288: #endif
289:
290: #elif defined(ULTRIX)
291: /* we don't want to use sys/resource.h under
292: Ultrix although this header exists. */
293: #undef HAVE_SYS_RESOURCE_H
294: #define HAVE_GMTOFF 1
295: #undef NO_KILLPG
296: #undef NO_SETSID
297: #define ULTRIX_BRAIN_DEATH
298: #define NEED_STRDUP
299: /* If you have Ultrix 4.3, and are using cc, const is broken */
300: #ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
301: #define const /* Not implemented */
302: #endif
303:
304: #elif defined(OSF1)
305: #define HAVE_GMTOFF 1
306: #undef NO_KILLPG
307: #undef NO_SETSID
308: #define HAVE_MMAP 1
309: #define USE_MMAP_SCOREBOARD
310: #define USE_MMAP_FILES
311: #define NO_LONG_DOUBLE
312: #define HAVE_SYSLOG 1
313: #define USE_FLOCK_SERIALIZED_ACCEPT
314: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
315:
316: #elif defined(PARAGON)
317: #define HAVE_GMTOFF 1
318: #undef NO_KILLPG
319: #undef NO_SETSID
320: #define HAVE_MMAP 1
321: #define USE_MMAP_SCOREBOARD
322: #define USE_MMAP_FILES
323: #define NO_LONG_DOUBLE
324: #define HAVE_SYSLOG 1
325: typedef int rlim_t;
326:
327: #elif defined(SEQUENT)
328: #define DEFAULT_USER "nobody"
329: #define DEFAULT_GROUP "nobody"
330: #define NO_SHMGET 1
331: #define HAVE_MMAP 1
332: #define HAVE_SYSLOG 1
333: #define USE_MMAP_FILES 1
334: #define USE_MMAP_SCOREBOARD 1
335: #define USE_FCNTL_SERIALIZED_ACCEPT 1
336: #define JMP_BUF sigjmp_buf
337: #undef NO_SETSID
338: #if SEQUENT < 40
339: typedef int rlim_t;
340: #define NO_GETTIMEOFDAY
341: #undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
342: #include <sys/times.h>
343: #endif
344: #if SEQUENT < 42
345: #define NEED_STRCASECMP
346: #define NEED_STRNCASECMP
347: #endif
348: #if SEQUENT < 44
349: #define NO_KILLPG 1
350: #define NET_SIZE_T int
351: #endif
352: #if SEQUENT >= 44
353: #undef NO_KILLPG
354: #define NET_SIZE_T size_t
355: #endif
356:
357: #elif defined(NEXT)
358: typedef unsigned short mode_t;
359: typedef int rlim_t;
360: #define HAVE_GMTOFF 1
361: #undef NO_KILLPG
362: #define NO_SETSID
363: #define NEED_STRDUP
364: #define NO_LINGCLOSE
365: #undef _POSIX_SOURCE
366: #ifndef FD_CLOEXEC
367: #define FD_CLOEXEC 1
368: #endif
369: #ifndef S_ISDIR
370: #define S_ISDIR(m) (((m)&(S_IFMT)) == (S_IFDIR))
371: #endif
372: #ifndef S_ISREG
373: #define S_ISREG(m) (((m)&(S_IFMT)) == (S_IFREG))
374: #endif
375: #ifndef S_IXUSR
376: #define S_IXUSR 00100
377: #endif
378: #ifndef S_IRGRP
379: #define S_IRGRP 00040
380: #endif
381: #ifndef S_IXGRP
382: #define S_IXGRP 00010
383: #endif
384: #ifndef S_IROTH
385: #define S_IROTH 00004
386: #endif
387: #ifndef S_IXOTH
388: #define S_IXOTH 00001
389: #endif
390: #ifndef S_IRUSR
391: #define S_IRUSR S_IREAD
392: #endif
393: #ifndef S_IWUSR
394: #define S_IWUSR S_IWRITE
395: #endif
396: #ifndef S_IWGRP
397: #define S_IWGRP 000020
398: #endif
399: #ifndef S_IWOTH
400: #define S_IWOTH 000002
401: #endif
402:
403: #define STDIN_FILENO 0
404: #define STDOUT_FILENO 1
405: #define STDERR_FILENO 2
406:
407: /* PR#2293 fix */
408: #define ap_wait_t union wait
409: #define waitpid(a,b,c) wait4((a) == -1 ? 0 : (a),(union wait *)(b),c,NULL)
410: #define WEXITSTATUS(status) (int)( WIFEXITED(status) ? ( (status).w_retcode ) : -1)
411: #define WTERMSIG(status) (int)( (status).w_termsig )
412:
413: typedef int pid_t;
414: #define USE_LONGJMP
415: #define NO_USE_SIGACTION
416: #define HAVE_SYSLOG 1
417:
418: #if defined(__DYNAMIC__)
419: #define HAVE_DYLD
420: #define DYLD_CANT_UNLOAD
421: #endif
422:
423: #elif defined(DARWIN) /* Darwin (Mac OS) */
424: #undef PLATFORM
425: #define PLATFORM "Darwin"
426: #define HAVE_DYLD
427: #define HAVE_GMTOFF
428: #define HAVE_MMAP
429: #define USE_MMAP_FILES
430: #define USE_MMAP_SCOREBOARD
431: #ifdef MAC_OS_X_SERVER
432: #define MAP_TMPFILE
433: #endif /* MAC_OS_X_SERVER */
434: #define HAVE_RESOURCE
435: #define HAVE_SNPRINTF
436: #define JMP_BUF jmp_buf
437: #define USE_LONGJMP
438: #define USE_FLOCK_SERIALIZED_ACCEPT
439: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
440: /*
441: * If you are using APACI, (you probably should be on Mac OS) these
442: * values are set at configure time.
443: */
444: #ifndef HTTPD_ROOT
445: #define HTTPD_ROOT "/Local/Library/WebServer"
446: #endif
447: #ifndef DOCUMENT_LOCATION
448: #define DOCUMENT_LOCATION HTTPD_ROOT "/Documents"
449: #endif
450: #ifndef DEFAULT_XFERLOG
451: #define DEFAULT_XFERLOG "Logs/Access"
452: #endif
453: #ifndef DEFAULT_ERRORLOG
454: #define DEFAULT_ERRORLOG "Logs/Errors"
455: #endif
456: #ifndef DEFAULT_PIDLOG
457: #define DEFAULT_PIDLOG "Logs/Process"
458: #endif
459: #ifndef DEFAULT_SCOREBOARD
460: #define DEFAULT_SCOREBOARD "Logs/Status"
461: #endif
462: #ifndef DEFAULT_LOCKFILE
463: #define DEFAULT_LOCKFILE "Logs/Lock"
464: #endif
465: #ifndef SERVER_CONFIG_FILE
466: #define SERVER_CONFIG_FILE "Configuration/Server"
467: #endif
468: #ifndef RESOURCE_CONFIG_FILE
469: #define RESOURCE_CONFIG_FILE "Configuration/Resources"
470: #endif
471: #ifndef TYPES_CONFIG_FILE
472: #define TYPES_CONFIG_FILE "Configuration/MIME"
473: #endif
474: #ifndef ACCESS_CONFIG_FILE
475: #define ACCESS_CONFIG_FILE "Configuration/Access"
476: #endif
477: #ifndef DEFAULT_USER_DIR
478: #define DEFAULT_USER_DIR "Library/Web Documents"
479: #endif
480: #ifndef DEFAULT_USER
481: #define DEFAULT_USER "www"
482: #endif
483: #ifndef DEFAULT_GROUP
484: #define DEFAULT_GROUP "www"
485: #endif
486: #ifndef DEFAULT_PATH
487: #define DEFAULT_PATH "/bin:/usr/bin:/usr/local/bin"
488: #endif
489:
490: #elif defined(LINUX)
491:
492: #if LINUX > 1
493: #include <features.h>
494:
495: /* libc4 systems probably still work, it probably doesn't define
496: * __GNU_LIBRARY__
497: * libc5 systems define __GNU_LIBRARY__ == 1, but don't define __GLIBC__
498: * glibc 2.x and later systems define __GNU_LIBRARY__ == 6, but list it as
499: * "deprecated in favour of __GLIBC__"; the value 6 will never be changed.
500: * glibc 1.x systems (i.e. redhat 4.x on sparc/alpha) should have
501: * __GLIBC__ < 2
502: * all glibc based systems need crypt.h
503: */
504: #if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
505: #include <crypt.h>
506: #endif
507:
508: /* glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *
509: * there's no way to discern between these two libraries. But using int should
510: * be portable because otherwise these libs would be hopelessly broken with
511: * reams of existing networking code. We'll use socklen_t * for 2.1.x and
512: * later.
513: *
514: * int works for all the earlier libs, and is picked up by default later.
515: */
516: #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
517: #define NET_SIZE_T socklen_t
518: #endif
519:
520: #define HAVE_SHMGET 1
521: #define USE_SHMGET_SCOREBOARD
522: #define HAVE_MMAP 1
523: #define USE_MMAP_FILES
524:
525: /* flock is faster ... but hasn't been tested on 1.x systems */
526: /* PR#3531 indicates flock() may not be stable, probably depends on
527: * kernel version. Go back to using fcntl, but provide a way for
528: * folks to tweak their Configuration to get flock.
529: */
530: #ifndef USE_FLOCK_SERIALIZED_ACCEPT
531: #define USE_FCNTL_SERIALIZED_ACCEPT
532: #endif
533:
534: #define SYS_SIGLIST _sys_siglist
535:
536: #else
537: #define USE_FCNTL_SERIALIZED_ACCEPT
538: #endif
539:
540: #undef HAVE_GMTOFF
541: #undef NO_KILLPG
542: #undef NO_SETSID
543: #undef NEED_STRDUP
544: #include <sys/time.h>
545: #define HAVE_SYSLOG 1
546:
547: /* glibc 2.1 and later finally define rlim_t */
548: #if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
549: typedef int rlim_t;
550: #endif
551:
552: #elif defined(SCO)
553: #undef HAVE_GMTOFF
554: #undef NO_KILLPG
555: #undef NO_SETSID
556: #define NEED_INITGROUPS
557: #define NO_WRITEV
558: #include <sys/time.h>
559: #define HAVE_SYSLOG 1
560: #undef HAVE_SYS_RESOURCE_H
561:
562: #elif defined(SCO5)
563:
564: #define USE_FCNTL_SERIALIZED_ACCEPT
565: #define HAVE_MMAP 1
566: #define USE_MMAP_SCOREBOARD
567: #define USE_MMAP_FILES
568: #define SecureWare
569: #define HAVE_SYSLOG 1
570:
571: /* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
572: consts. Sigh. */
573: extern int strcasecmp(const char *, const char *);
574: extern int strncasecmp(const char *, const char *, unsigned);
575:
576: #elif defined(AUX3)
577: /* These are to let -Wall compile more cleanly */
578: extern int strcasecmp(const char *, const char *);
579: extern int strncasecmp(const char *, const char *, unsigned);
580: extern int set42sig(), getopt(), getpeername(), bzero();
581: extern int listen(), bind(), socket(), getsockname();
582: extern int accept(), gethostname(), connect(), lstat();
583: extern int select(), killpg(), shutdown();
584: extern int initgroups(), setsockopt();
585: extern char *shmat();
586: extern int shmctl();
587: extern int shmget();
588: extern char *sbrk();
589: extern char *crypt();
590: #include <sys/time.h>
591: #undef HAVE_GMTOFF
592: #undef NO_KILLPG
593: #undef NO_SETSID
594: #define NEED_STRDUP
595: /* fcntl() locking is expensive with NFS */
596: #define USE_FLOCK_SERIALIZED_ACCEPT
597: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
598: #define HAVE_SHMGET 1
599: #define USE_SHMGET_SCOREBOARD
600: /*
601: * NOTE: If when you run Apache under A/UX and you get a warning
602: * that httpd couldn't move break, then the below value for
603: * MOVEBREAK (64megs) is too large for your setup. Try reducing
604: * to 0x2000000 which is still PLENTY of space. I doubt if
605: * even on heavy systems sbrk() would be called at all...
606: */
607: #define MOVEBREAK 0x4000000
608: #define NO_LINGCLOSE
609: #define NO_SLACK
610: #define HAVE_SYSLOG 1
611: #undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
612:
613: #elif defined(SVR4)
614: #define NO_KILLPG
615: #undef NO_SETSID
616: #undef NEED_STRDUP
617: #ifndef MPRAS
618: #define NEED_STRCASECMP
619: #ifndef ENCORE
620: #define NEED_STRNCASECMP
621: #endif /* ENCORE */
622: #endif /* MPRAS */
623: #define bzero(a,b) memset(a,0,b)
624: /* A lot of SVR4 systems need this */
625: #ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
626: #define USE_FCNTL_SERIALIZED_ACCEPT
627: #endif
628: #define HAVE_SYSLOG 1
629: #define NET_SIZE_T size_t
630: #define HAVE_SHMGET 1
631: #define USE_SHMGET_SCOREBOARD
632: #ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */
633: #define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */
634: #define _KMEMUSER /* Enable SHM_R/SHM_W defines in <shm.h> */
635: #undef NEED_STRCASECMP
636: #undef NEED_STRNCASECMP
637: #undef bzero
638: #endif /*_OSD_POSIX*/
639:
640: #elif defined(UW)
641: #if UW < 700
642: #define USE_FCNTL_SERIALIZED_ACCEPT
643: #define NO_LINGCLOSE
644: #define NO_KILLPG
645: #endif
646: #undef NO_SETSID
647: #undef NEED_STRDUP
648: #define NEED_STRCASECMP
649: #define NEED_STRNCASECMP
650: #define bzero(a,b) memset(a,0,b)
651: #define HAVE_MMAP 1
652: #define USE_MMAP_SCOREBOARD
653: #define USE_MMAP_FILES
654: #define HAVE_SHMGET 1
655: #undef USE_SHMGET_SCOREBOARD /* force use of mmap() scoreboard */
656: #include <sys/time.h>
657: #if UW >= 200
658: #define _POSIX_SOURCE
659: #endif
660: #define NET_SIZE_T size_t
661: #define HAVE_SYSLOG 1
662:
663: #elif defined(DGUX)
664: #define NO_KILLPG
665: #undef NO_SETSID
666: #undef NEED_STRDUP
667: #ifdef _IX86_DG
668: #undef NEED_STRCASECMP
669: #undef NEED_STRNCASECMP
670: #else
671: #define NEED_STRCASECMP
672: #define NEED_STRNCASECMP
673: #endif
674: #define bzero(a,b) memset(a,0,b)
675: /* A lot of SVR4 systems need this */
676: #define USE_FCNTL_SERIALIZED_ACCEPT
677: #define ap_inet_addr inet_network
678: #define HAVE_SYSLOG 1
679:
680: #elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(NETBSD)
681: #define HAVE_GMTOFF 1
682: #undef NO_KILLPG
683: #undef NO_SETSID
684: #define HAVE_SYSLOG 1
685: #ifndef DEFAULT_USER
686: #define DEFAULT_USER "nobody"
687: #endif
688: #ifndef DEFAULT_GROUP
689: #define DEFAULT_GROUP "nogroup"
690: #endif
691: #define HAVE_SHMGET 1
692: #define HAVE_MMAP 1
693: #define USE_MMAP_SCOREBOARD
694: #define USE_MMAP_FILES
695: #define USE_FLOCK_SERIALIZED_ACCEPT
696: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
697:
698: #elif defined(UTS21)
699: #undef HAVE_GMTOFF
700: #undef NO_KILLPG
701: #define NO_SETSID
702: #define NEED_WAITPID
703: #define STDIN_FILENO 0
704: #define STDOUT_FILENO 1
705: #define STDERR_FILENO 2
706: #define HAVE_SYSLOG 1
707: #define USE_LONGJMP
708: #define JMP_BUF jmp_buf
709: #define NO_USE_SIGACTION
710: #define NEED_STRERROR
711: #define NEED_STRSTR
712: #define NEED_HASHBANG_EMUL
713: #define NDELAY_PIPE_RETURNS_ZERO
714: #define NO_DATA NO_ADDRESS
715: #define ap_wait_t union wait
716: #define WEXITSTATUS(status) (int)((status).w_retcode)
717: #define WTERMSIG(status) (int)((status).w_termsig)
718: #define strftime(buf,bufsize,fmt,tm) ascftime(buf,fmt,tm)
719: #undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
720: #include <sys/types.h>
721: #include <sys/time.h>
722:
723: #elif defined(APOLLO)
724: #undef HAVE_GMTOFF
725: #undef NO_KILLPG
726: #undef NO_SETSID
727: #define HAVE_SYSLOG 1
728:
729: #elif defined(__FreeBSD__) || defined(__bsdi__)
730: #if defined(__FreeBSD__)
731: #include <osreldate.h>
732: #endif
733: #define HAVE_GMTOFF 1
734: #undef NO_KILLPG
735: #undef NO_SETSID
736: #define HAVE_MMAP 1
737: #define USE_MMAP_SCOREBOARD
738: #define USE_MMAP_FILES
739: #ifndef DEFAULT_USER
740: #define DEFAULT_USER "nobody"
741: #endif
742: #ifndef DEFAULT_GROUP
743: #define DEFAULT_GROUP "nogroup"
744: #endif
745: #if defined(__bsdi__) || \
746: (defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
747: typedef quad_t rlim_t;
748: #endif
749: #define USE_FLOCK_SERIALIZED_ACCEPT
750: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
751: #define HAVE_SYSLOG 1
752: #define SYS_SIGLIST sys_siglist
753: #if (defined(__FreeBSD_version) && (__FreeBSD_version >= 400000))
754: #define NET_SIZE_T socklen_t
755: #endif
756:
757: #elif defined(QNX)
758: #ifndef crypt
759: char *crypt(const char *pw, const char *salt);
760: #endif
761: #ifndef initgroups
762: int initgroups(char *, int);
763: #endif
764: #ifndef strncasecmp
765: #define strncasecmp strnicmp
766: #endif
767: #undef NO_KILLPG
768: #undef NO_SETSID
769: #define NEED_INITGROUPS
770: #define NEED_SELECT_H
771: #define NEED_PROCESS_H
772: #include <unix.h>
773: #define HAVE_MMAP 1
774: #define USE_POSIX_SCOREBOARD
775: #define USE_FLOCK_SERIALIZED_ACCEPT
776: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
777: #define HAVE_SYSLOG 1
778:
779: #elif defined(LYNXOS)
780: #undef HAVE_GMTOFF
781: #undef USE_MMAP_SCOREBOARD
782: #undef USE_SHMGET_SCOREBOARD
783: #undef USE_FCNTL_SERIALIZED_ACCEPT
784: #undef USE_FLOCK_SERIALIZED_ACCEPT
785: #define USE_LONGJMP
786: #undef NO_KILLPG
787: #undef NO_SETSID
788: #undef NO_USE_SIGACTION
789: #undef NO_LINGCLOSE
790: extern char *crypt(char *pw, char *salt);
791: typedef int rlim_t;
792: #define HAVE_SYSLOG 1
793:
794: #elif defined(UXPDS)
795: #undef NEED_STRCASECMP
796: #undef NEED_STRNCASECMP
797: #undef NEED_STRDUP
798: #undef HAVE_GMTOFF
799: #define NO_KILLPG
800: #undef NO_SETSID
801: #define bzero(a,b) memset(a,0,b)
802: #define USE_FCNTL_SERIALIZED_ACCEPT
803: #define HAVE_MMAP 1
804: #define USE_MMAP_SCOREBOARD
805: #define USE_MMAP_FILES
806: #define HAVE_SYSLOG 1
807:
808: #elif defined(OS2)
809: /* Defines required for EMX OS/2 port. */
810: #define NO_KILLPG
811: #define NEED_STRCASECMP
812: #define NEED_STRNCASECMP
813: #define NEED_PROCESS_H
814: #define NO_SETSID
815: #define NO_TIMES
816: #define CASE_BLIND_FILESYSTEM
817: /* Add some drive name support */
818: #define chdir _chdir2
819: #include <sys/time.h>
820: #define MAXSOCKETS 2048
821: #define USE_OS2_SCOREBOARD
822: #define NO_RELIABLE_PIPED_LOGS
823: #define USE_OS2SEM_SERIALIZED_ACCEPT
824: #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
825: #define NO_SLACK
826: #define FOPEN_REQUIRES_T
827:
828: #elif defined(__MACHTEN__)
829: typedef int rlim_t;
830: #undef NO_KILLPG
831: #define NO_SETSID
832: #define HAVE_GMTOFF 1
833: #ifndef __MACHTEN_PPC__
834: #ifndef __MACHTEN_68K__
835: #define __MACHTEN_68K__
836: #endif
837: #define USE_FLOCK_SERIALIZED_ACCEPT
838: #define NO_USE_SIGACTION
839: #define JMP_BUF sigjmp_buf
840: #define USE_LONGJMP
841: #undef NEED_STRDUP
842: #else
843: #define HAVE_SHMGET 1
844: #define USE_SHMGET_SCOREBOARD
845: #define USE_FCNTL_SERIALIZED_ACCEPT
846: #endif
847:
848: /* Convex OS v11 */
849: #elif defined(CONVEXOS11)
850: #undef HAVE_GMTOFF
851: #undef NO_KILLPG
852: #undef NO_SETSID
853: #undef NEED_STRDUP
854: #define HAVE_MMAP 1
855: #define USE_MMAP_SCOREBOARD
856: #define USE_MMAP_FILES
857: #define HAVE_SYSLOG 1
858:
859: #define NO_TIMEZONE
860: #include <stdio.h>
861: #include <sys/types.h>
862: typedef int rlim_t;
863:
864: #elif defined(ISC)
865: #include <net/errno.h>
866: #define NO_KILLPG
867: #undef NO_SETSID
868: #define HAVE_SHMGET 1
869: #define USE_SHMGET_SCOREBOARD
870: #define USE_FCNTL_SERIALIZED_ACCEPT
871: #define HAVE_SYSLOG 1
872:
873: #elif defined(NEWSOS)
874: #define HAVE_SHMGET 1
875: #define USE_SHMGET_SCOREBOARD
876: #define USE_LONGJMP
877: #define NO_SETSID
878: #define NO_USE_SIGACTION
879: #define NEED_WAITPID
880: #define NO_OTHER_CHILD
881: #define HAVE_SYSLOG 1
882: #include <sys/time.h>
883: #include <stdlib.h>
884: #include <sys/types.h>
885: typedef int pid_t;
886: typedef int rlim_t;
887: typedef int mode_t;
888:
889: #elif defined(RISCIX)
890: #include <sys/time.h>
891: typedef int rlim_t;
892: #define NO_USE_SIGACTION
893: #define USE_LONGJMP
894: #define NEED_STRCASECMP
895: #define NEED_STRNCASECMP
896: #define NEED_STRDUP
897:
898: #elif defined(BEOS)
899: #undef PLATFORM
900: #define PLATFORM "BeOS"
901: #include <stddef.h>
902:
903: #define NO_WRITEV
904: #define NO_KILLPG
905: #define NEED_INITGROUPS
906: #define PF_INET AF_INET
907: #define S_IEXEC S_IXUSR
908:
909: #elif defined(_CX_SX)
910: #define JMP_BUF sigjmp_buf
911: #include <sys/types.h>
912: #include <sys/time.h>
913:
914: #elif defined(WIN32)
915:
916: /* All windows stuff is now in os/win32/os.h */
917:
918: #elif defined(TPF) /* IBM Transaction Processing Facility operating system */
919:
920: #include <tpfeq.h>
921: #include <tpfio.h>
922: #include <sysapi.h>
923: #include <sysgtime.h>
924: #define PRIMECRAS 0x010000
925: #define JMP_BUF jmp_buf
926: #define HAVE_SHMGET
927: #undef HAVE_SYS_RESOURCE_H
928: #define NEED_INITGROUPS
929: #define NEED_SIGNAL_INTERRUPT
930: #include <strings.h>
931: #ifndef __strings_h
932: #define NEED_STRCASECMP
933: #define NEED_STRNCASECMP
934: #endif
935: #define NEED_STRDUP
936: #define NO_DBM_REWRITEMAP
937: #define NO_GETTIMEOFDAY
938: #define NO_KILLPG
939: #define NO_LINGCLOSE
940: #define NO_MMAP
941: #define NO_OTHER_CHILD
942: #define NO_PIPED_LOGS
943: #define NO_RELIABLE_PIPED_LOGS
944: #define NO_SETSID
945: #define NO_SLACK
946: #define NO_TIMES
947: #define NO_USE_SIGACTION
948: #define USE_LONGJMP
949: /*#define USE_SHMGET_SCOREBOARD*/
950: #define USE_TPF_ACCEPT
951: #define USE_TPF_CORE_SERIALIZED_ACCEPT
952: /*#define USE_TPF_DAEMON*/
953: #define USE_TPF_SCOREBOARD
954: #define USE_TPF_SELECT
955: #define S_IREAD S_IRUSR
956: #define S_IWRITE S_IWUSR
957: #define S_IEXEC S_IXUSR
958: #define crypt(buf,salt) ((char *)buf)
959: #undef offsetof
960: #define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field))
961:
962: #elif defined(__TANDEM)
963: #define NO_WRITEV
964: #define NO_KILLPG
965: #define NEED_INITGROUPS
966: #define NO_SLACK
967:
968: #elif defined(OS390) /* IBM OS/390 Operating System */
969: #define HAVE_MMAP
970: #define HAVE_SHMGET
971: #define USE_SHMGET_SCOREBOARD
972: #define USE_MMAP_FILES
973: #define NEED_UNION_SEMUN
974: #define USE_SYSVSEM_SERIALIZED_ACCEPT
975: #define _POSIX_SOURCE
976: #include <signal.h>
977: #ifdef SIGDUMP /* SIGDUMP is not defined by OS/390 v1r2 */
978: #define NSIG SIGDUMP+1
979: #else
980: #define NSIG 40
981: #endif
982: #define JMP_BUF sigjmp_buf
983: #define _XOPEN_SOURCE_EXTENDED 1
984: #define _OPEN_MSGQ_EXT
985: #define _XOPEN_SOURCE
986: #define SHM_R S_IRUSR
987: #define SHM_W S_IWUSR
988: #include <sys/time.h>
989: #include <sys/types.h>
990: #include <sys/msg.h>
991: #include <sys/socket.h>
992: #define NET_SIZE_T size_t
993: #define NEED_HASHBANG_EMUL
994:
995: #else
996: /* Unknown system - Edit these to match */
997: #ifdef BSD
998: #define HAVE_GMTOFF 1
999: #else
1000: #undef HAVE_GMTOFF
1001: #endif
1002: /* NO_KILLPG is set on systems that don't have killpg */
1003: #undef NO_KILLPG
1004: /* NO_SETSID is set on systems that don't have setsid */
1005: #undef NO_SETSID
1006: /* NEED_STRDUP is set on stupid systems that don't have strdup. */
1007: #undef NEED_STRDUP
1008: #endif
1009:
1010: #ifdef HAVE_SYS_PARAM_H
1011: #include <sys/param.h>
1012: #endif /* HAVE_SYS_PARAM_H */
1013:
1014: /* stuff marked API_EXPORT is part of the API, and intended for use
1015: * by modules
1016: */
1017: #ifndef API_EXPORT
1018: #define API_EXPORT(type) type
1019: #endif
1020:
1021: /* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
1022: * use by modules. The difference between API_EXPORT and
1023: * API_EXPORT_NONSTD is that the latter is required for any functions
1024: * which use varargs or are used via indirect function call. This
1025: * is to accomodate the two calling conventions in windows dlls.
1026: */
1027: #ifndef API_EXPORT_NONSTD
1028: #define API_EXPORT_NONSTD(type) type
1029: #endif
1030:
1031: #ifndef MODULE_VAR_EXPORT
1032: #define MODULE_VAR_EXPORT
1033: #endif
1034: #ifndef API_VAR_EXPORT
1035: #define API_VAR_EXPORT
1036: #endif
1037:
1038: /* modules should not used functions marked CORE_EXPORT
1039: * or CORE_EXPORT_NONSTD */
1040: #ifndef CORE_EXPORT
1041: #define CORE_EXPORT API_EXPORT
1042: #endif
1043: #ifndef CORE_EXPORT_NONSTD
1044: #define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
1045: #endif
1046:
1047: /* On Darwin, symbols that conflict with loaded dylibs
1048: * (eg. System framework) need to be declared as private symbols with
1049: * __private_extern__.
1050: * For other systems, make that a no-op.
1051: */
1052: #if defined(DARWIN) && defined(__DYNAMIC__)
1053: #define ap_private_extern __private_extern__
1054: #else
1055: #define ap_private_extern
1056: #endif
1057:
1058: /*
1059: * The particular directory style your system supports. If you have dirent.h
1060: * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
1061: * that file and define DIR_TYPE to be dirent. Otherwise, if you have
1062: * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
1063: * file. If you have neither, I'm confused.
1064: */
1065:
1066: #ifndef NETWARE
1067: #include <sys/types.h>
1068: #endif
1069: #include <stdarg.h>
1070:
1071: #if !defined(NEXT) && !defined(WIN32)
1072: #include <dirent.h>
1073: #define DIR_TYPE dirent
1074: #elif !defined(WIN32)
1075: #include <sys/dir.h>
1076: #define DIR_TYPE direct
1077: #else
1078: #define DIR_TYPE dirent
1079: #endif
1080:
1081: #include <stdio.h>
1082: #include <stdlib.h>
1083: #include <string.h>
1084: #ifdef __TANDEM
1085: #include <strings.h>
1086: #endif
1087: #include "ap_ctype.h"
1088: #if !defined(MPE) && !defined(WIN32) && !defined(TPF) && !defined(__TANDEM) && !defined(NETWARE)
1089: #include <sys/file.h>
1090: #endif
1091: #if !defined(WIN32) && !defined(NETWARE)
1092: #include <sys/socket.h>
1093: #ifdef HAVE_SYS_SELECT_H
1094: #include <sys/select.h>
1095: #endif /* HAVE_SYS_SELECT_H */
1096: #ifndef TPF
1097: #include <netinet/in.h>
1098: #endif /* TPF */
1099: #if defined(OS390) && !defined(NO_ADDRESS)
1100: #define NO_ADDRESS NO_DATA /* Not defined properly by OS/390 v1r2 */
1101: #endif
1102: #include <netdb.h>
1103: #include <sys/ioctl.h>
1104: #if !defined(MPE) && !defined(BEOS) && !defined(TPF)
1105: #include <arpa/inet.h> /* for inet_ntoa */
1106: #endif
1107: #include <sys/wait.h>
1108: #include <pwd.h>
1109: #include <grp.h>
1110: #include <fcntl.h>
1111: #ifndef BEOS
1112: #define closesocket(s) close(s)
1113: #endif
1114: #ifndef O_BINARY
1115: #define O_BINARY (0)
1116: #endif
1117: #endif /* ndef WIN32 */
1118:
1119: #include <limits.h>
1120: #include <time.h> /* for ctime */
1121: #ifdef WIN32
1122: #define strftime(s,max,format,tm) os_strftime(s,max,format,tm)
1123: #endif
1124: #include <signal.h>
1125: #ifdef NETWARE
1126: #undef SIGKILL
1127: #undef SA_NOCLDSTOP
1128: #undef SIGALRM
1129: #undef SIGCHILD
1130: #undef SIGCONT
1131: #undef SIGHUP
1132: #undef SIGPIPE
1133: #undef SIGQUIT
1134: #undef SIGSTOP
1135: #undef SIGTSTP
1136: #undef SIGTTIN
1137: #undef SIGTTOU
1138: #undef SIGUSR1
1139: #undef SIGUSR2
1140: #undef SIG_BLOCK
1141: #undef SIG_SETMASK
1142: #undef SIG_UNBLOCK
1143: #endif
1144: #if defined(TPF) && defined(NSIG)
1145: #undef NSIG
1146: #endif
1147: #include <errno.h>
1148: #if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT) && !defined(TPF) && !defined(NETWARE) && !defined(MPE)
1149: #include <memory.h>
1150: #endif
1151:
1152: #ifdef NEED_PROCESS_H
1153: #include <process.h>
1154: #endif
1155:
1156: #ifdef WIN32
1157: #include "../include/hsregex.h"
1158: #elif defined(USE_HSREGEX)
1159: #include "hsregex.h"
1160: #else
1161: #include <regex.h>
1162: #endif
1163:
1164: #ifdef HAVE_SYS_RESOURCE_H
1165: #include <sys/resource.h>
1166: #ifdef SUNOS4
1167: int getrlimit(int, struct rlimit *);
1168: int setrlimit(int, struct rlimit *);
1169: #endif
1170: #endif
1171: #ifdef USE_MMAP_SCOREBOARD
1172: #if !defined(OS2) && !defined(WIN32)
1173: /* This file is not needed for OS/2 */
1174: #include <sys/mman.h>
1175: #endif
1176: #endif
1177: #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
1178: #define MAP_ANON MAP_ANONYMOUS
1179: #endif
1180:
1181: #if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
1182: #undef USE_MMAP_FILES
1183: #endif
1184:
1185: #if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
1186: #undef USE_MMAP_SCOREBOARD
1187: #endif
1188:
1189: #if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) || !defined(HAVE_SHMGET))
1190: #undef USE_SHMGET_SCOREBOARD
1191: #endif
1192:
1193: #ifndef LOGNAME_MAX
1194: #define LOGNAME_MAX 25
1195: #endif
1196:
1197: #ifdef HAVE_UNISTD_H
1198: #include <unistd.h>
1199: #endif
1200:
1201: #ifdef ultrix
1202: #define ULTRIX_BRAIN_DEATH
1203: #endif
1204:
1205: #ifndef S_ISLNK
1206: #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
1207: #endif
1208:
1209: #ifndef INADDR_NONE
1210: #define INADDR_NONE ((unsigned long) -1)
1211: #endif
1212:
1213: /*
1214: * Replace signal function with sigaction equivalent
1215: */
1216: #ifndef NO_USE_SIGACTION
1217: typedef void Sigfunc(int);
1218:
1219: #if defined(SIG_IGN) && !defined(SIG_ERR)
1220: #define SIG_ERR ((Sigfunc *)-1)
1221: #endif
1222:
1223: /*
1224: * For some strange reason, QNX defines signal to signal. Eliminate it.
1225: */
1226: #ifdef signal
1227: #undef signal
1228: #endif
1229: #define signal(s,f) ap_signal(s,f)
1230: Sigfunc *signal(int signo, Sigfunc * func);
1231: #endif
1232:
1233: #include <setjmp.h>
1234:
1235: #if defined(USE_LONGJMP)
1236: #define ap_longjmp(x, y) longjmp((x), (y))
1237: #define ap_setjmp(x) setjmp(x)
1238: #ifndef JMP_BUF
1239: #define JMP_BUF jmp_buf
1240: #endif
1241: #else
1242: #define ap_longjmp(x, y) siglongjmp((x), (y))
1243: #define ap_setjmp(x) sigsetjmp((x), 1)
1244: #ifndef JMP_BUF
1245: #define JMP_BUF sigjmp_buf
1246: #endif
1247: #endif
1248:
1249: /* Majority of os's want to verify FD_SETSIZE */
1250: #if !defined(WIN32) && !defined(TPF) && !defined(NETWARE)
1251: #define CHECK_FD_SETSIZE
1252: #endif
1253:
1254: #ifdef USE_TPF_SELECT
1255: #define ap_select(_a, _b, _c, _d, _e) \
1256: tpf_select(_a, _b, _c, _d, _e)
1257: #elif defined(SELECT_NEEDS_CAST)
1258: #define ap_select(_a, _b, _c, _d, _e) \
1259: select((_a), (int *)(_b), (int *)(_c), (int *)(_d), (_e))
1260: #else
1261: #define ap_select(_a, _b, _c, _d, _e) \
1262: select(_a, _b, _c, _d, _e)
1263: #endif
1264:
1265: #ifdef USE_TPF_ACCEPT
1266: #define ap_accept(_fd, _sa, _ln) tpf_accept(_fd, _sa, _ln)
1267: #else
1268: #define ap_accept(_fd, _sa, _ln) accept(_fd, _sa, _ln)
1269: #endif
1270:
1271: #ifdef NEED_SIGNAL_INTERRUPT
1272: #define ap_check_signals() tpf_process_signals()
1273: #else
1274: #define ap_check_signals()
1275: #endif
1276:
1277: #ifdef ULTRIX_BRAIN_DEATH
1278: #define ap_fdopen(d,m) fdopen((d), (char *)(m))
1279: #else
1280: #define ap_fdopen(d,m) fdopen((d), (m))
1281: #endif
1282:
1283: #ifndef ap_inet_addr
1284: #define ap_inet_addr inet_addr
1285: #endif
1286:
1287: #ifdef NO_OTHER_CHILD
1288: #define NO_RELIABLE_PIPED_LOGS
1289: #endif
1290:
1291: /* When the underlying OS doesn't support exec() of scripts which start
1292: * with a HASHBANG (#!) followed by interpreter name and args, define this.
1293: */
1294: #ifdef NEED_HASHBANG_EMUL
1295: extern int ap_execle(const char *filename, const char *arg,...);
1296: extern int ap_execve(const char *filename, char * const argv[],
1297: char * const envp[]);
1298: /* ap_execle() is a wrapper function around ap_execve(). */
1299: #define execle ap_execle
1300: #define execve(path,argv,envp) ap_execve(path,argv,envp)
1301: #endif
1302:
1303: /* Finding offsets of elements within structures.
1304: * Taken from the X code... they've sweated portability of this stuff
1305: * so we don't have to. Sigh...
1306: */
1307:
1308: #if defined(CRAY) || (defined(__arm) && !defined(LINUX))
1309: #ifdef __STDC__
1310: #define XtOffset(p_type,field) _Offsetof(p_type,field)
1311: #else
1312: #ifdef CRAY2
1313: #define XtOffset(p_type,field) \
1314: (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
1315:
1316: #else /* !CRAY2 */
1317:
1318: #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
1319:
1320: #endif /* !CRAY2 */
1321: #endif /* __STDC__ */
1322: #else /* ! (CRAY || __arm) */
1323:
1324: #define XtOffset(p_type,field) \
1325: ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
1326:
1327: #endif /* !CRAY */
1328:
1329: #ifdef offsetof
1330: #define XtOffsetOf(s_type,field) offsetof(s_type,field)
1331: #else
1332: #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
1333: #endif
1334:
1335: /*
1336: * NET_SIZE_T exists because of shortsightedness on the POSIX committee. BSD
1337: * systems used "int *" as the parameter to accept(), getsockname(),
1338: * getpeername() et al. Consequently many unixes took an int * for that
1339: * parameter. The POSIX committee decided that "int" was just too generic and
1340: * had to be replaced with size_t almost everywhere. There's no problem with
1341: * that when you're passing by value. But when you're passing by reference
1342: * this creates a gross source incompatibility with existing programs. On
1343: * 32-bit architectures it creates only a warning. On 64-bit architectures it
1344: * creates broken code -- because "int *" is a pointer to a 64-bit quantity and
1345: * "size_t *" is frequently a pointer to a 32-bit quantity.
1346: *
1347: * Some Unixes adopted "size_t *" for the sake of POSIX compliance. Others
1348: * ignored it because it was such a broken interface. Chaos ensued. POSIX
1349: * finally woke up and decided that it was wrong and created a new type
1350: * socklen_t. The only useful value for socklen_t is int, and that's how
1351: * everyone who has a clue implements it. It is almost always the case that
1352: * NET_SIZE_T should be defined to be an int, unless the system being compiled
1353: * for was created in the window of POSIX madness.
1354: */
1355: #ifndef NET_SIZE_T
1356: #define NET_SIZE_T int
1357: #endif
1358:
1359: /* Linux defines __WCOREDUMP, but doesn't define WCOREDUMP unless __USE_BSD
1360: * is in use... we'd prefer to just use WCOREDUMP everywhere.
1361: */
1362: #if defined(__WCOREDUMP) && !defined(WCOREDUMP)
1363: #define WCOREDUMP __WCOREDUMP
1364: #endif
1365:
1366: #ifdef SUNOS_LIB_PROTOTYPES
1367: /* Prototypes needed to get a clean compile with gcc -Wall.
1368: * Believe it or not, these do have to be declared, at least on SunOS,
1369: * because they aren't mentioned in the relevant system headers.
1370: * Sun Quality Software. Gotta love it. This section is not
1371: * currently (13Nov97) used.
1372: */
1373:
1374: int getopt(int, char **, char *);
1375:
1376: int strcasecmp(const char *, const char *);
1377: int strncasecmp(const char *, const char *, int);
1378: int toupper(int);
1379: int tolower(int);
1380:
1381: int printf(char *,...);
1382: int fprintf(FILE *, char *,...);
1383: int fputs(char *, FILE *);
1384: int fread(char *, int, int, FILE *);
1385: int fwrite(char *, int, int, FILE *);
1386: int fgetc(FILE *);
1387: char *fgets(char *s, int, FILE*);
1388: int fflush(FILE *);
1389: int fclose(FILE *);
1390: int ungetc(int, FILE *);
1391: int _filbuf(FILE *); /* !!! */
1392: int _flsbuf(unsigned char, FILE *); /* !!! */
1393: int sscanf(char *, char *,...);
1394: void setbuf(FILE *, char *);
1395: void perror(char *);
1396:
1397: time_t time(time_t *);
1398: int strftime(char *, int, const char *, struct tm *);
1399:
1400: int initgroups(char *, int);
1401: int wait3(int *, int, void *); /* Close enough for us... */
1402: int lstat(const char *, struct stat *);
1403: int stat(const char *, struct stat *);
1404: int flock(int, int);
1405: #ifndef NO_KILLPG
1406: int killpg(int, int);
1407: #endif
1408: int socket(int, int, int);
1409: int setsockopt(int, int, int, const char *, int);
1410: int listen(int, int);
1411: int bind(int, struct sockaddr *, int);
1412: int connect(int, struct sockaddr *, int);
1413: int accept(int, struct sockaddr *, int *);
1414: int shutdown(int, int);
1415:
1416: int getsockname(int s, struct sockaddr *name, int *namelen);
1417: int getpeername(int s, struct sockaddr *name, int *namelen);
1418: int gethostname(char *name, int namelen);
1419: void syslog(int, char *,...);
1420: char *mktemp(char *);
1421:
1422: int vfprintf(FILE *, const char *, va_list);
1423:
1424: #endif /* SUNOS_LIB_PROTOTYPES */
1425:
1426: /* The assumption is that when the functions are missing,
1427: * then there's no matching prototype available either.
1428: * Declare what is needed exactly as the replacement routines implement it.
1429: */
1430: #ifdef NEED_STRDUP
1431: extern char *strdup (const char *str);
1432: #endif
1433: #ifdef NEED_STRCASECMP
1434: extern int strcasecmp (const char *a, const char *b);
1435: #endif
1436: #ifdef NEED_STRNCASECMP
1437: extern int strncasecmp (const char *a, const char *b, int n);
1438: #endif
1439: #ifdef NEED_INITGROUPS
1440: extern int initgroups(const char *name, gid_t basegid);
1441: #endif
1442: #ifdef NEED_WAITPID
1443: extern int waitpid(pid_t pid, int *statusp, int options);
1444: #endif
1445: #ifdef NEED_STRERROR
1446: extern char *strerror (int err);
1447: #endif
1448: #ifdef NEED_DIFFTIME
1449: extern double difftime(time_t time1, time_t time0);
1450: #endif
1451:
1452: #ifndef ap_wait_t
1453: #define ap_wait_t int
1454: #endif
1455:
1456: #ifdef __cplusplus
1457: }
1458: #endif
1459:
1460: #endif /* !AP_CONFIG_H */
E-mail: