1 /* ====================================================================
2 * Copyright (c) 1995-1998 The Apache Group. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * 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
13 * the documentation and/or other materials provided with the
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/)."
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
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.
30 * 6. Redistributions of any form whatsoever must retain the following
32 * "This product includes software developed by the Apache Group
33 * for use in the Apache HTTP server project (http://www.apache.org/)."
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 * ====================================================================
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/>.
66 * ap_config.h: system-dependant #defines and includes...
67 * See PORTING for a listing of what they mean
71 * Support for platform dependent autogenerated defines
74 #include "ap_config_auto.h"
76 /* not available under WIN32, so provide important entries manually */
80 /* Have to include sys/stat.h before ../os/win32/os.h so we can override
82 #include <sys/types.h>
86 /* include process.h first so we can override spawn[lv]e* properly */
88 #include "os/win32/os.h"
93 #if !defined(QNX) && !defined(MPE) && !defined(WIN32)
94 #include <sys/param.h>
97 /* Define one of these according to your system. */
100 #define JMP_BUF sigjmp_buf
101 #define NO_LONG_DOUBLE
102 #define USE_FLOCK_SERIALIZED_ACCEPT
104 #define EAGAIN EWOULDBLOCK
105 int initgroups (char *, int);
106 char *crypt (const char *pw, const char *salt);
107 int gethostname (char *name, int namelen);
110 #include <sys/times.h>
114 #define HAVE_SHMGET 1
115 #define USE_SHMGET_SCOREBOARD
116 #define SHM_R 0400 /* Read permission */
117 #define SHM_W 0200 /* Write permission */
118 #define NEED_INITGROUPS
119 #define NEED_STRCASECMP
121 #define NEED_STRNCASECMP
122 extern void GETPRIVMODE();
123 extern void GETUSERMODE();
124 extern char *inet_ntoa();
126 #define NO_GETTIMEOFDAY
127 #define S_IEXEC S_IXUSR
128 #define S_IREAD S_IRUSR
129 #define S_IWRITE S_IWUSR
130 #define PF_INET AF_INET
132 #elif defined(SUNOS4)
133 #define HAVE_GMTOFF 1
136 char *crypt(const char *pw, const char *salt);
137 char *mktemp(char *template);
139 #define USE_MMAP_SCOREBOARD
140 #define USE_MMAP_FILES
141 #include <sys/time.h>
142 #define NEED_STRERROR
145 #define memmove(a,b,c) memcpy(a, b, c)
148 #define USE_FLOCK_SERIALIZED_ACCEPT
149 #define NEED_DIFFTIME
150 #define HAVE_SYSLOG 1
152 #elif defined(SOLARIS2)
156 #if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
157 !defined(USE_PTHREAD_SERIALIZED_ACCEPT)
158 #define USE_FCNTL_SERIALIZED_ACCEPT
160 #define NEED_UNION_SEMUN
162 #define USE_MMAP_SCOREBOARD
163 #define USE_MMAP_FILES
165 /* AFS Websecure tweak to compile on Linux */
166 #if ! defined(AIX) && ! defined(HAVE_UNISTD_H)
167 int gethostname(char *name, int namelen);
168 #endif /* ! defined(AIX) && ! defined(HAVE_UNISTD_H) */
170 #define HAVE_SYSLOG 1
171 #define SYS_SIGLIST _sys_siglist
175 /* IRIX has killpg, but it's only in _BSD_COMPAT, so don't use it in case
176 * there's some weird conflict with non-BSD signals */
179 #if !defined(USE_FCNTL_SERIALIZED_ACCEPT) && !defined(USE_USLOCK_SERIALIZED_ACCEPT)
180 #define USE_SYSVSEM_SERIALIZED_ACCEPT
182 #define HAVE_SHMGET 1
183 #define USE_SHMGET_SCOREBOARD
185 #define USE_MMAP_FILES
186 #define NO_LONG_DOUBLE
188 #define HAVE_SYSLOG 1
197 #define HAVE_SHMGET 1
198 #define USE_SHMGET_SCOREBOARD
199 #define SELECT_NEEDS_CAST
200 #define HAVE_SYSLOG 1
202 #elif defined(HPUX) || defined(HPUX10)
206 #define USE_FCNTL_SERIALIZED_ACCEPT
210 #define HAVE_SHMGET 1
211 #define USE_SHMGET_SCOREBOARD
212 #define HAVE_SYSLOG 1
214 #define SELECT_NEEDS_CAST
218 #elif defined(HPUX11)
223 #define USE_SHMGET_SCOREBOARD
225 #define USE_FCNTL_SERIALIZED_ACCEPT
226 /* feeling brave? want to try using POSIX mutexes? */
227 /* #define HAVE_MMAP */
228 /* #define USE_MMAP_SCOREBOARD */
229 /* #define USE_MMAP_FILES */
230 /* #define USE_PTHREAD_SERIALIZED_ACCEPT */
241 #define USE_MMAP_SCOREBOARD
242 #define USE_MMAP_FILES
243 #define HAVE_SYSLOG 1
244 #ifndef DEFAULT_GROUP
245 #define DEFAULT_GROUP "nobody"
249 #define DEFAULT_USER "nobody"
254 #define USE_FCNTL_SERIALIZED_ACCEPT
256 #define memmove(a,b,c) memcpy(a, b, c)
259 #define NET_SIZE_T size_t
262 #elif defined(ULTRIX)
263 #define HAVE_GMTOFF 1
266 #define ULTRIX_BRAIN_DEATH
268 /* If you have Ultrix 4.3, and are using cc, const is broken */
269 #ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
270 #define const /* Not implemented */
274 #define HAVE_GMTOFF 1
278 #define USE_MMAP_SCOREBOARD
279 #define USE_MMAP_FILES
280 #define NO_LONG_DOUBLE
281 #define HAVE_SYSLOG 1
282 #define USE_FLOCK_SERIALIZED_ACCEPT
283 #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
285 #elif defined(PARAGON)
286 #define HAVE_GMTOFF 1
290 #define USE_MMAP_SCOREBOARD
291 #define USE_MMAP_FILES
292 #define NO_LONG_DOUBLE
293 #define HAVE_SYSLOG 1
296 #elif defined(SEQUENT)
297 #define HAVE_GMTOFF 1
301 #define HAVE_SYSLOG 1
304 typedef unsigned short mode_t;
305 #define HAVE_GMTOFF 1
315 #define S_ISDIR(m) (((m)&(S_IFMT)) == (S_IFDIR))
318 #define S_ISREG(m) (((m)&(S_IFMT)) == (S_IFREG))
321 #define S_IXUSR 00100
324 #define S_IRGRP 00040
327 #define S_IXGRP 00010
330 #define S_IROTH 00004
333 #define S_IXOTH 00001
336 #define S_IRUSR S_IREAD
339 #define S_IWUSR S_IWRITE
342 #define S_IWGRP 000020
345 #define S_IWOTH 000002
349 typedef u_long n_long;
352 #define STDIN_FILENO 0
353 #define STDOUT_FILENO 1
354 #define STDERR_FILENO 2
357 #define ap_wait_t union wait
358 #define waitpid(a,b,c) wait4((a) == -1 ? 0 : (a),(union wait *)(b),c,NULL)
359 #define WEXITSTATUS(status) (int)( WIFEXITED(status) ? ( (status).w_retcode ) : -1)
360 #define WTERMSIG(status) (int)( (status).w_termsig )
364 #define NO_USE_SIGACTION
365 #define HAVE_SYSLOG 1
370 #include <features.h>
372 /* libc4 systems probably still work, it probably doesn't define
374 * libc5 systems define __GNU_LIBRARY__ == 1, but don't define __GLIBC__
375 * glibc 2.x and later systems define __GNU_LIBRARY__ == 6, but list it as
376 * "deprecated in favour of __GLIBC__"; the value 6 will never be changed.
377 * glibc 1.x systems (i.e. redhat 4.x on sparc/alpha) should have
379 * all glibc based systems need crypt.h
381 #if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
385 /* glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *
386 * there's no way to discern between these two libraries. But using int should
387 * be portable because otherwise these libs would be hopelessly broken with
388 * reams of existing networking code. We'll use socklen_t * for 2.1.x and
391 * int works for all the earlier libs, and is picked up by default later.
393 #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
394 #define NET_SIZE_T socklen_t
397 #define HAVE_SHMGET 1
398 #define USE_SHMGET_SCOREBOARD
400 #define USE_MMAP_FILES
402 /* glibc 2.1 and later finally define rlim_t */
403 #if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
407 /* flock is faster ... but hasn't been tested on 1.x systems */
408 #define USE_FLOCK_SERIALIZED_ACCEPT
410 #define SYS_SIGLIST _sys_siglist
413 #define USE_FCNTL_SERIALIZED_ACCEPT
420 #include <sys/time.h>
421 #define HAVE_SYSLOG 1
427 #define NEED_INITGROUPS
429 #include <sys/time.h>
430 #define HAVE_SYSLOG 1
434 #define USE_FCNTL_SERIALIZED_ACCEPT
436 #define USE_MMAP_SCOREBOARD
437 #define USE_MMAP_FILES
439 #define HAVE_SYSLOG 1
441 /* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
443 extern int strcasecmp(const char *, const char *);
444 extern int strncasecmp(const char *, const char *, unsigned);
447 /* These are to let -Wall compile more cleanly */
448 extern int strcasecmp(const char *, const char *);
449 extern int strncasecmp(const char *, const char *, unsigned);
450 extern int set42sig(), getopt(), getpeername();
451 extern int listen(), bind(), socket(), getsockname();
452 extern int accept(), gethostname(), connect(), lstat();
453 extern int select(), killpg(), shutdown();
454 extern int initgroups(), setsockopt();
455 extern char *shmat();
459 extern char *crypt();
460 #include <sys/time.h>
465 /* fcntl() locking is expensive with NFS */
466 #define USE_FLOCK_SERIALIZED_ACCEPT
467 #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
468 #define HAVE_SHMGET 1
469 #define USE_SHMGET_SCOREBOARD
471 * NOTE: If when you run Apache under A/UX and you get a warning
472 * that httpd couldn't move break, then the below value for
473 * MOVEBREAK (64megs) is too large for your setup. Try reducing
474 * to 0x2000000 which is still PLENTY of space. I doubt if
475 * even on heavy systems sbrk() would be called at all...
477 #define MOVEBREAK 0x4000000
480 #define HAVE_SYSLOG 1
481 #undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
488 #define NEED_STRCASECMP
490 #define NEED_STRNCASECMP
493 /* A lot of SVR4 systems need this */
494 #ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
495 #define USE_FCNTL_SERIALIZED_ACCEPT
497 #define HAVE_SYSLOG 1
498 #define NET_SIZE_T size_t
499 #define HAVE_SHMGET 1
500 #define USE_SHMGET_SCOREBOARD
501 #ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */
502 #define NEED_INITGROUPS
503 #define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */
505 #undef USE_SHMGET_SCOREBOARD
507 #endif /*_OSD_POSIX*/
514 #define NEED_STRCASECMP
515 #define NEED_STRNCASECMP
517 #define USE_MMAP_SCOREBOARD
518 #define USE_MMAP_FILES
519 #define HAVE_SHMGET 1
520 #undef USE_SHMGET_SCOREBOARD /* force use of mmap() scoreboard */
521 #include <sys/time.h>
523 #define _POSIX_SOURCE
525 #define NET_SIZE_T size_t
526 #define HAVE_SYSLOG 1
527 #define USE_FCNTL_SERIALIZED_ACCEPT
533 #define NEED_STRCASECMP
534 #define NEED_STRNCASECMP
535 /* A lot of SVR4 systems need this */
536 #define USE_FCNTL_SERIALIZED_ACCEPT
537 #define ap_inet_addr inet_network
538 #define HAVE_SYSLOG 1
540 #elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(NETBSD)
541 #define HAVE_GMTOFF 1
544 #define HAVE_SYSLOG 1
546 #define DEFAULT_USER "nobody"
548 #ifndef DEFAULT_GROUP
549 #define DEFAULT_GROUP "nogroup"
550 #define HAVE_SHMGET 1
552 #define USE_MMAP_SCOREBOARD
553 #define USE_MMAP_FILES
561 #define STDIN_FILENO 0
562 #define STDOUT_FILENO 1
563 #define STDERR_FILENO 2
564 #define HAVE_SYSLOG 1
566 #define JMP_BUF jmp_buf
567 #define NO_USE_SIGACTION
568 #define NEED_STRERROR
570 #define NEED_HASHBANG_EMUL
571 #define NDELAY_PIPE_RETURNS_ZERO
572 #define NO_DATA NO_ADDRESS
573 #define ap_wait_t union wait
574 #define WEXITSTATUS(status) (int)((status).w_retcode)
575 #define WTERMSIG(status) (int)((status).w_termsig)
576 #define strftime(buf,bufsize,fmt,tm) ascftime(buf,fmt,tm)
577 #include <sys/types.h>
578 #include <sys/time.h>
580 #elif defined(APOLLO)
584 #define HAVE_SYSLOG 1
586 #elif defined(__FreeBSD__) || defined(__bsdi__)
587 #if defined(__FreeBSD__)
588 #include <osreldate.h>
590 #define HAVE_GMTOFF 1
594 #define USE_MMAP_SCOREBOARD
595 #define USE_MMAP_FILES
597 #define DEFAULT_USER "nobody"
599 #ifndef DEFAULT_GROUP
600 #define DEFAULT_GROUP "nogroup"
602 #if defined(__bsdi__) || \
603 (defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
604 typedef quad_t rlim_t;
606 #define USE_FLOCK_SERIALIZED_ACCEPT
607 #define HAVE_SYSLOG 1
608 #define SYS_SIGLIST sys_siglist
612 char *crypt(const char *pw, const char *salt);
615 int initgroups(char *, int);
618 #define strncasecmp strnicmp
622 #define NEED_INITGROUPS
623 #define NEED_SELECT_H
624 #define NEED_PROCESS_H
627 #define USE_POSIX_SCOREBOARD
628 #define USE_FLOCK_SERIALIZED_ACCEPT
629 #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
630 #define HAVE_SYSLOG 1
632 #elif defined(LYNXOS)
634 #undef USE_MMAP_SCOREBOARD
635 #undef USE_SHMGET_SCOREBOARD
636 #undef USE_FCNTL_SERIALIZED_ACCEPT
637 #undef USE_FLOCK_SERIALIZED_ACCEPT
641 #undef NO_USE_SIGACTION
643 extern char *crypt(char *pw, char *salt);
645 #define HAVE_SYSLOG 1
648 #undef NEED_STRCASECMP
649 #undef NEED_STRNCASECMP
654 #define USE_FCNTL_SERIALIZED_ACCEPT
656 #define USE_MMAP_SCOREBOARD
657 #define USE_MMAP_FILES
658 #define HAVE_SYSLOG 1
660 #elif defined(__EMX__)
661 /* Defines required for EMX OS/2 port. */
663 #define NEED_STRCASECMP
664 #define NEED_STRNCASECMP
667 /* ap_config_auto.h gets this wrong, force sys/select.h to be included */
668 #define HAVE_SYS_SELECT_H
669 #define CASE_BLIND_FILESYSTEM
670 /* Add some drive name support */
671 #define chdir _chdir2
672 #include <sys/time.h>
673 #define MAXSOCKETS 4096
674 #define USE_OS2_SCOREBOARD
675 #define NO_RELIABLE_PIPED_LOGS
677 #elif defined(__MACHTEN__)
681 #define HAVE_GMTOFF 1
682 #ifndef __MACHTEN_PPC__
683 #ifndef __MACHTEN_68K__
684 #define __MACHTEN_68K__
686 #define USE_FLOCK_SERIALIZED_ACCEPT
687 #define NO_USE_SIGACTION
688 #define JMP_BUF sigjmp_buf
692 #define HAVE_SHMGET 1
693 #define USE_SHMGET_SCOREBOARD
694 #define USE_FCNTL_SERIALIZED_ACCEPT
698 #elif defined(CONVEXOS11)
704 #define USE_MMAP_SCOREBOARD
705 #define USE_MMAP_FILES
706 #define HAVE_SYSLOG 1
710 #include <sys/types.h>
714 #include <net/errno.h>
717 #define HAVE_SHMGET 1
718 #define USE_SHMGET_SCOREBOARD
719 #define USE_FCNTL_SERIALIZED_ACCEPT
720 #define HAVE_SYSLOG 1
722 #elif defined(NEWSOS)
723 #define HAVE_SHMGET 1
724 #define USE_SHMGET_SCOREBOARD
727 #define NO_USE_SIGACTION
729 #define NO_OTHER_CHILD
730 #define HAVE_SYSLOG 1
731 #include <sys/time.h>
733 #include <sys/types.h>
738 #elif defined(RISCIX)
739 #include <sys/time.h>
741 #define NO_USE_SIGACTION
743 #define NEED_STRCASECMP
744 #define NEED_STRNCASECMP
752 #define NEED_INITGROUPS
756 /* All windows stuff is now in os/win32/os.h */
759 /* Unknown system - Edit these to match */
761 #define HAVE_GMTOFF 1
765 /* NO_KILLPG is set on systems that don't have killpg */
767 /* NO_SETSID is set on systems that don't have setsid */
769 /* NEED_STRDUP is set on stupid systems that don't have strdup. */
773 /* stuff marked API_EXPORT is part of the API, and intended for use
777 #define API_EXPORT(type) type
780 /* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
781 * use by modules. The difference between API_EXPORT and
782 * API_EXPORT_NONSTD is that the latter is required for any functions
783 * which use varargs or are used via indirect function call. This
784 * is to accomodate the two calling conventions in windows dlls.
786 #ifndef API_EXPORT_NONSTD
787 #define API_EXPORT_NONSTD(type) type
790 #ifndef MODULE_VAR_EXPORT
791 #define MODULE_VAR_EXPORT
793 #ifndef API_VAR_EXPORT
794 #define API_VAR_EXPORT
797 /* modules should not used functions marked CORE_EXPORT
798 * or CORE_EXPORT_NONSTD */
800 #define CORE_EXPORT API_EXPORT
802 #ifndef CORE_EXPORT_NONSTD
803 #define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
806 /* So that we can use inline on some critical functions, and use
807 * GNUC attributes (such as to get -Wall warnings for printf-like
808 * functions). Only do this in gcc 2.7 or later ... it may work
809 * on earlier stuff, but why chance it.
811 * We've since discovered that the gcc shipped with NeXT systems
812 * as "cc" is completely broken. It claims to be __GNUC__ and so
813 * on, but it doesn't implement half of the things that __GNUC__
814 * means. In particular it's missing inline and the __attribute__
815 * stuff. So we hack around it. PR#1613. -djg
817 #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7 || defined(NEXT)
819 #define __attribute__(__x)
820 #define ENUM_BITFIELD(e,n,w) signed int n : w
822 #define ap_inline __inline__
823 #define USE_GNU_INLINE
824 #define ENUM_BITFIELD(e,n,w) e n : w
828 * The particular directory style your system supports. If you have dirent.h
829 * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
830 * that file and define DIR_TYPE to be dirent. Otherwise, if you have
831 * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
832 * file. If you have neither, I'm confused.
835 #include <sys/types.h>
838 #if !defined(NEXT) && !defined(WIN32)
840 #define DIR_TYPE dirent
841 #elif !defined(WIN32)
843 #define DIR_TYPE direct
845 #define DIR_TYPE dirent
851 #include "ap_ctype.h"
852 #if !defined(MPE) && !defined(WIN32)
853 #include <sys/file.h>
856 #include <sys/socket.h>
857 #ifdef HAVE_SYS_SELECT_H
858 #include <sys/select.h>
859 #endif /* HAVE_SYS_SELECT_H */
860 #include <netinet/in.h>
862 #include <sys/ioctl.h>
863 #if !defined(MPE) && !defined(BEOS)
864 #include <arpa/inet.h> /* for inet_ntoa */
866 #include <sys/wait.h>
871 #define closesocket(s) close(s)
881 #endif /* ndef WIN32 */
883 #include <time.h> /* for ctime */
886 #if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT)
890 #ifdef NEED_PROCESS_H
895 #include "include/hsregex.h"
896 #elif defined(USE_HSREGEX)
902 #ifdef HAVE_SYS_RESOURCE_H
903 #include <sys/resource.h>
905 int getrlimit(int, struct rlimit *);
906 int setrlimit(int, struct rlimit *);
909 #ifdef USE_MMAP_SCOREBOARD
910 #if !defined(__EMX__) && !defined(WIN32)
911 /* This file is not needed for OS/2 */
912 #include <sys/mman.h>
915 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
916 #define MAP_ANON MAP_ANONYMOUS
919 #if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
920 #undef USE_MMAP_FILES
923 #if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
924 #undef USE_MMAP_SCOREBOARD
927 #if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) || !defined(HAVE_SHMGET))
928 #undef USE_SHMGET_SCOREBOARD
932 #define LOGNAME_MAX 25
940 #define ULTRIX_BRAIN_DEATH
944 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
948 #define INADDR_NONE ((unsigned long) -1)
952 * Replace signal function with sigaction equivalent
954 #ifndef NO_USE_SIGACTION
955 typedef void Sigfunc(int);
957 #if defined(SIG_IGN) && !defined(SIG_ERR)
958 #define SIG_ERR ((Sigfunc *)-1)
962 * For some strange reason, QNX defines signal to signal. Eliminate it.
967 #define signal(s,f) ap_signal(s,f)
968 Sigfunc *signal(int signo, Sigfunc * func);
973 #if defined(USE_LONGJMP)
974 #define ap_longjmp(x, y) longjmp((x), (y))
975 #define ap_setjmp(x) setjmp(x)
977 #define JMP_BUF jmp_buf
980 #define ap_longjmp(x, y) siglongjmp((x), (y))
981 #define ap_setjmp(x) sigsetjmp((x), 1)
983 #define JMP_BUF sigjmp_buf
987 #ifdef SELECT_NEEDS_CAST
988 #define ap_select(_a, _b, _c, _d, _e) \
989 select((_a), (int *)(_b), (int *)(_c), (int *)(_d), (_e))
991 #define ap_select select
994 #ifdef ULTRIX_BRAIN_DEATH
995 #define ap_fdopen(d,m) fdopen((d), (char *)(m))
997 #define ap_fdopen(d,m) fdopen((d), (m))
1000 #ifndef ap_inet_addr
1001 #define ap_inet_addr inet_addr
1004 #ifdef NO_OTHER_CHILD
1005 #define NO_RELIABLE_PIPED_LOGS
1008 /* When the underlying OS doesn't support exec() of scripts which start
1009 * with a HASHBANG (#!) followed by interpreter name and args, define this.
1011 #ifdef NEED_HASHBANG_EMUL
1012 extern int ap_execle(const char *filename, const char *arg,...);
1013 extern int ap_execve(const char *filename, const char *argv[],
1014 const char *envp[]);
1015 /* ap_execle() is a wrapper function around ap_execve(). */
1016 #define execle ap_execle
1017 #define execve(path,argv,envp) ap_execve(path,argv,envp)
1020 /* Finding offsets of elements within structures.
1021 * Taken from the X code... they've sweated portability of this stuff
1022 * so we don't have to. Sigh...
1025 #if defined(CRAY) || (defined(__arm) && !defined(LINUX))
1027 #define XtOffset(p_type,field) _Offsetof(p_type,field)
1030 #define XtOffset(p_type,field) \
1031 (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
1035 #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
1038 #endif /* __STDC__ */
1039 #else /* ! (CRAY || __arm) */
1041 #define XtOffset(p_type,field) \
1042 ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
1047 #define XtOffsetOf(s_type,field) offsetof(s_type,field)
1049 #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
1053 * NET_SIZE_T exists because of shortsightedness on the POSIX committee. BSD
1054 * systems used "int *" as the parameter to accept(), getsockname(),
1055 * getpeername() et al. Consequently many unixes took an int * for that
1056 * parameter. The POSIX committee decided that "int" was just too generic and
1057 * had to be replaced with size_t almost everywhere. There's no problem with
1058 * that when you're passing by value. But when you're passing by reference
1059 * this creates a gross source incompatibility with existing programs. On
1060 * 32-bit architectures it creates only a warning. On 64-bit architectures it
1061 * creates broken code -- because "int *" is a pointer to a 64-bit quantity and
1062 * "size_t *" is frequently a pointer to a 32-bit quantity.
1064 * Some Unixes adopted "size_t *" for the sake of POSIX compliance. Others
1065 * ignored it because it was such a broken interface. Chaos ensued. POSIX
1066 * finally woke up and decided that it was wrong and created a new type
1067 * socklen_t. The only useful value for socklen_t is int, and that's how
1068 * everyone who has a clue implements it. It is almost always the case that
1069 * NET_SIZE_T should be defined to be an int, unless the system being compiled
1070 * for was created in the window of POSIX madness.
1073 #define NET_SIZE_T int
1076 /* Linux defines __WCOREDUMP, but doesn't define WCOREDUMP unless __USE_BSD
1077 * is in use... we'd prefer to just use WCOREDUMP everywhere.
1079 #if defined(__WCOREDUMP) && !defined(WCOREDUMP)
1080 #define WCOREDUMP __WCOREDUMP
1083 #ifdef SUNOS_LIB_PROTOTYPES
1084 /* Prototypes needed to get a clean compile with gcc -Wall.
1085 * Believe it or not, these do have to be declared, at least on SunOS,
1086 * because they aren't mentioned in the relevant system headers.
1087 * Sun Quality Software. Gotta love it. This section is not
1088 * currently (13Nov97) used.
1091 int getopt(int, char **, char *);
1093 int strcasecmp(const char *, const char *);
1094 int strncasecmp(const char *, const char *, int);
1098 int printf(char *,...);
1099 int fprintf(FILE *, char *,...);
1100 int fputs(char *, FILE *);
1101 int fread(char *, int, int, FILE *);
1102 int fwrite(char *, int, int, FILE *);
1104 char *fgets(char *s, int, FILE*);
1107 int ungetc(int, FILE *);
1108 int _filbuf(FILE *); /* !!! */
1109 int _flsbuf(unsigned char, FILE *); /* !!! */
1110 int sscanf(char *, char *,...);
1111 void setbuf(FILE *, char *);
1112 void perror(char *);
1114 time_t time(time_t *);
1115 int strftime(char *, int, const char *, struct tm *);
1117 int initgroups(char *, int);
1118 int wait3(int *, int, void *); /* Close enough for us... */
1119 int lstat(const char *, struct stat *);
1120 int stat(const char *, struct stat *);
1121 int flock(int, int);
1123 int killpg(int, int);
1125 int socket(int, int, int);
1126 int setsockopt(int, int, int, const char *, int);
1127 int listen(int, int);
1128 int bind(int, struct sockaddr *, int);
1129 int connect(int, struct sockaddr *, int);
1130 int accept(int, struct sockaddr *, int *);
1131 int shutdown(int, int);
1133 int getsockname(int s, struct sockaddr *name, int *namelen);
1134 int getpeername(int s, struct sockaddr *name, int *namelen);
1135 int gethostname(char *name, int namelen);
1136 void syslog(int, char *,...);
1137 char *mktemp(char *);
1139 long vfprintf(FILE *, const char *, va_list);
1141 #endif /* SUNOS_LIB_PROTOTYPES */
1143 /* The assumption is that when the functions are missing,
1144 * then there's no matching prototype available either.
1145 * Declare what is needed exactly as the replacement routines implement it.
1148 extern char *strdup (const char *str);
1150 #ifdef NEED_STRCASECMP
1151 extern int strcasecmp (const char *a, const char *b);
1153 #ifdef NEED_STRNCASECMP
1154 extern int strncasecmp (const char *a, const char *b, int n);
1156 #ifdef NEED_INITGROUPS
1157 extern int initgroups(const char *name, gid_t basegid);
1160 extern int waitpid(pid_t pid, int *statusp, int options);
1162 #ifdef NEED_STRERROR
1163 extern char *strerror (int err);
1165 #ifdef NEED_DIFFTIME
1166 extern double difftime(time_t time1, time_t time0);
1170 #define ap_wait_t int
1177 #endif /* !AP_CONFIG_H */