ap_config.h revision c3200c488bb3f941a88d5bed94abef0f46946bd3
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* ====================================================================
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * The Apache Software License, Version 1.1
e942c741056732f50da2074b36fe59805d370650slive *
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd * Copyright (c) 2000 The Apache Software Foundation. All rights
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * reserved.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd *
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding * Redistribution and use in source and binary forms, with or without
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding * modification, are permitted provided that the following conditions
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding * are met:
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding *
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding * 1. Redistributions of source code must retain the above copyright
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding * notice, this list of conditions and the following disclaimer.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd *
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * 2. Redistributions in binary form must reproduce the above copyright
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * notice, this list of conditions and the following disclaimer in
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * the documentation and/or other materials provided with the
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * distribution.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd *
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * 3. The end-user documentation included with the redistribution,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * if any, must include the following acknowledgment:
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * "This product includes software developed by the
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd * Apache Software Foundation (http://www.apache.org/)."
7db9f691a00ead175b03335457ca296a33ddf31bnd * Alternately, this acknowledgment may appear in the software itself,
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * if and wherever such third-party acknowledgments normally appear.
6aada32e978e09cc60d52cb05ae4cee91b676da1slive *
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * 4. The names "Apache" and "Apache Software Foundation" must
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * not be used to endorse or promote products derived from this
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * software without prior written permission. For written
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * permission, please contact apache@apache.org.
6aada32e978e09cc60d52cb05ae4cee91b676da1slive *
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * 5. Products derived from this software may not be called "Apache",
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * nor may "Apache" appear in their name, without prior written
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * permission of the Apache Software Foundation.
6aada32e978e09cc60d52cb05ae4cee91b676da1slive *
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
080b1313a70a1fc4b16d013c157fe17cf946def1wrowe * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * SUCH DAMAGE.
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * ====================================================================
6aada32e978e09cc60d52cb05ae4cee91b676da1slive *
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * This software consists of voluntary contributions made by many
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * individuals on behalf of the Apache Software Foundation. For more
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * information on the Apache Software Foundation, please see
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * <http://www.apache.org/>.
125d98ea072ec180d9c84b447fdb72b9d0abd911nd *
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * Portions of this software are based upon public domain software
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive * originally written at the National Center for Supercomputing Applications,
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * University of Illinois, Urbana-Champaign.
6aada32e978e09cc60d52cb05ae4cee91b676da1slive */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef AP_CONFIG_H
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define AP_CONFIG_H
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifdef __cplusplus
6aada32e978e09cc60d52cb05ae4cee91b676da1sliveextern "C" {
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifdef HAVE_CONFIG_H
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#include "ap_ac_config.h" /* If we're using autoconf, go to the new
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd ap_config.h replacement */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#else /* HAVE_CONFIG_H */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/*
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * ap_config.h: system-dependant #defines and includes...
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * See PORTING for a listing of what they mean
6aada32e978e09cc60d52cb05ae4cee91b676da1slive */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#include "ap_mmn.h" /* MODULE_MAGIC_NUMBER_ */
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd/*
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * Support for platform dependent autogenerated defines
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd */
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#ifndef WIN32
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#include "ap_config_auto.h"
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#else
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd/* not available under WIN32, so provide important entries manually */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef HAVE_UNISTD_H
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd/* Have to include sys/stat.h before ../os/win32/os.h so we can override
6aada32e978e09cc60d52cb05ae4cee91b676da1slivestat() properly */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#include <sys/types.h>
c14037646789087319802aaada2e8534ccab0158slive#include <sys/stat.h>
c14037646789087319802aaada2e8534ccab0158slive
c14037646789087319802aaada2e8534ccab0158slive#ifdef HAVE_UNISTD_H
c14037646789087319802aaada2e8534ccab0158slive#include <unistd.h>
c14037646789087319802aaada2e8534ccab0158slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* So that we can use inline on some critical functions, and use
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * GNUC attributes (such as to get -Wall warnings for printf-like
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * functions). Only do this in gcc 2.7 or later ... it may work
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * on earlier stuff, but why chance it.
6aada32e978e09cc60d52cb05ae4cee91b676da1slive *
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * We've since discovered that the gcc shipped with NeXT systems
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd * as "cc" is completely broken. It claims to be __GNUC__ and so
ba9f66695f8cfc60182e7e28b16ef4e2c420234dniq * on, but it doesn't implement half of the things that __GNUC__
ba9f66695f8cfc60182e7e28b16ef4e2c420234dniq * means. In particular it's missing inline and the __attribute__
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * stuff. So we hack around it. PR#1613. -djg
6aada32e978e09cc60d52cb05ae4cee91b676da1slive */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#if !defined(__GNUC__) || __GNUC__ < 2 || \
6aada32e978e09cc60d52cb05ae4cee91b676da1slive (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
6aada32e978e09cc60d52cb05ae4cee91b676da1slive defined(NEXT)
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define ap_inline
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define __attribute__(__x)
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define ENUM_BITFIELD(e,n,w) signed int n : w
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#else
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define ap_inline __inline__
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define USE_GNU_INLINE
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define ENUM_BITFIELD(e,n,w) e n : w
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifdef WIN32
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#include "../os/win32/os.h"
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#else
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#include "os.h"
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#endif
62e64f05a63cbe2a99769e472e048d9852376e59rbowen
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#if !defined(QNX) && !defined(MPE) && !defined(WIN32) && !defined(TPF)
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive/* #include <sys/param.h> */
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd
b4dc2db16858150c14fddf184ee1b06358a97f3brbowen/* Define one of these according to your system. */
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#if defined(MINT)
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslivetypedef int rlim_t;
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define JMP_BUF sigjmp_buf
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#define NO_LONG_DOUBLE
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define USE_FLOCK_SERIALIZED_ACCEPT
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define _BSD_SOURCE
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define EAGAIN EWOULDBLOCK
dce4ff5d881d942f1ba7822d432eecd39f5166d2ndint initgroups (char *, int);
dce4ff5d881d942f1ba7822d432eecd39f5166d2ndchar *crypt (const char *pw, const char *salt);
dce4ff5d881d942f1ba7822d432eecd39f5166d2ndint gethostname (char *name, int namelen);
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#elif defined(MPE)
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#include <sys/times.h>
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define NO_SETSID
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define NO_KILLPG
2df40fa998d3364133c4dd29eb395f5ae70dfc1fslive#define NO_WRITEV
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_SHMGET 1
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define USE_SHMGET_SCOREBOARD
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define SHM_R 0400 /* Read permission */
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define SHM_W 0200 /* Write permission */
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define NEED_INITGROUPS
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define NEED_STRCASECMP
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define NEED_STRDUP
7d94bab0593be2d11cb273082e5748d317998916rbowen#define NEED_STRNCASECMP
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowenextern void GETPRIVMODE();
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jimextern void GETUSERMODE();
7d94bab0593be2d11cb273082e5748d317998916rbowenextern char *inet_ntoa();
7d94bab0593be2d11cb273082e5748d317998916rbowen#define NO_SLACK
7d94bab0593be2d11cb273082e5748d317998916rbowen#define NO_GETTIMEOFDAY
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define S_IEXEC S_IXUSR
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define S_IREAD S_IRUSR
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define S_IWRITE S_IWUSR
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define PF_INET AF_INET
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#elif defined(SUNOS4)
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define HAVE_GMTOFF 1
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#undef NO_KILLPG
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#undef NO_SETSID
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowenchar *crypt(const char *pw, const char *salt);
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowenchar *mktemp(char *template);
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define HAVE_MMAP 1
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define USE_MMAP_SCOREBOARD
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define USE_MMAP_FILES
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#include <sys/time.h>
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define NEED_STRERROR
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowentypedef int rlim_t;
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define memmove(a,b,c) bcopy(b,a,c)
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define NO_LINGCLOSE
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define USE_FLOCK_SERIALIZED_ACCEPT
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#define NEED_DIFFTIME
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define HAVE_SYSLOG 1
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#elif defined(SOLARIS2)
d532243d6b832de8d4e1e3164f477d45003967efcovener#undef HAVE_GMTOFF
d532243d6b832de8d4e1e3164f477d45003967efcovener#define NO_KILLPG
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#undef NO_SETSID
bd6b02eddff1618ac8ead9201d8782790f52aaa2rbowen#define bzero(a,b) memset(a,0,b)
d532243d6b832de8d4e1e3164f477d45003967efcovener#if !defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && \
d532243d6b832de8d4e1e3164f477d45003967efcovener !defined(USE_PTHREAD_SERIALIZED_ACCEPT)
d532243d6b832de8d4e1e3164f477d45003967efcovener#define USE_FCNTL_SERIALIZED_ACCEPT
d532243d6b832de8d4e1e3164f477d45003967efcovener#endif
d532243d6b832de8d4e1e3164f477d45003967efcovener#define NEED_UNION_SEMUN
d532243d6b832de8d4e1e3164f477d45003967efcovener#define HAVE_MMAP 1
d532243d6b832de8d4e1e3164f477d45003967efcovener#define USE_MMAP_SCOREBOARD
d532243d6b832de8d4e1e3164f477d45003967efcovener#define USE_MMAP_FILES
289be2de00fa2af22152b99ac401c474347631e5trawickint gethostname(char *name, int namelen);
d532243d6b832de8d4e1e3164f477d45003967efcovener#define HAVE_SYSLOG 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define SYS_SIGLIST _sys_siglist
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef INADDR_NONE
080b1313a70a1fc4b16d013c157fe17cf946def1wrowe#define INADDR_NONE ((unsigned int) 0xffffffff)
080b1313a70a1fc4b16d013c157fe17cf946def1wrowe#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#elif defined(IRIX)
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef HAVE_GMTOFF
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* IRIX has killpg, but it's only in _BSD_COMPAT, so don't use it in case
6aada32e978e09cc60d52cb05ae4cee91b676da1slive * there's some weird conflict with non-BSD signals */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NO_KILLPG
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef NO_SETSID
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#if !defined(USE_FLOCK_SERIALIZED_ACCEPT) && \
6aada32e978e09cc60d52cb05ae4cee91b676da1slive !defined(USE_USLOCK_SERIALIZED_ACCEPT) && \
fed984f5264bfdc7ccb8b5ee90c49c54102e4683slive !defined(USE_SYSVSEM_SERIALIZED_ACCEPT)
080b1313a70a1fc4b16d013c157fe17cf946def1wrowe#define USE_FCNTL_SERIALIZED_ACCEPT
fed984f5264bfdc7ccb8b5ee90c49c54102e4683slive#endif
fed984f5264bfdc7ccb8b5ee90c49c54102e4683slive#define HAVE_SHMGET 1
fed984f5264bfdc7ccb8b5ee90c49c54102e4683slive#define USE_SHMGET_SCOREBOARD
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_MMAP 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_MMAP_FILES
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NO_LONG_DOUBLE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NO_LINGCLOSE
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim#define HAVE_SYSLOG 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#elif defined(HIUX)
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#undef HAVE_GMTOFF
8c722836aa0aa144be915ecdeee7588a279ebed5nd#define NO_KILLPG
8c722836aa0aa144be915ecdeee7588a279ebed5nd#undef NO_SETSID
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef _HIUX_SOURCE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define _HIUX_SOURCE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_SHMGET 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_SHMGET_SCOREBOARD
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define SELECT_NEEDS_CAST
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_SYSLOG 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#elif defined(HPUX) || defined(HPUX10)
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef HAVE_GMTOFF
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NO_KILLPG
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef NO_SETSID
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_FCNTL_SERIALIZED_ACCEPT
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef _HPUX_SOURCE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define _HPUX_SOURCE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_SHMGET 1
3c6800a13e431bd39ab1b3e100cd9779c0ea435dyoshiki#define USE_SHMGET_SCOREBOARD
860b4efe27e7c1c9a2bf5c872b29c90f76849b51jim#define HAVE_SYSLOG 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef HPUX10
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define SELECT_NEEDS_CAST
103f414dc9a63f76c48bc1d81162ea6f3c5ef495slivetypedef int rlim_t;
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#elif defined(HPUX11)
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef _HPUX_SOURCE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define _HPUX_SOURCE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_SHMGET
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_SHMGET_SCOREBOARD
b76a31daaa6e83bb0fd627a04f20e82bffcf1df4poirier#undef HAVE_GMTOFF
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_FCNTL_SERIALIZED_ACCEPT
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* feeling brave? want to try using POSIX mutexes? */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* #define HAVE_MMAP */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* #define USE_MMAP_SCOREBOARD */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* #define USE_MMAP_FILES */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* #define USE_PTHREAD_SERIALIZED_ACCEPT */
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define NO_KILLPG
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#undef NO_SETSID
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define HAVE_SYSLOG
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#elif defined(AIX)
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#undef HAVE_GMTOFF
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#undef NO_KILLPG
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#undef NO_SETSID
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#ifndef __ps2__
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_MMAP 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_MMAP_SCOREBOARD
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define USE_MMAP_FILES
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define HAVE_SYSLOG 1
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#ifndef DEFAULT_GROUP
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define DEFAULT_GROUP "nobody"
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#ifndef DEFAULT_USER
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define DEFAULT_USER "nobody"
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#endif
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#ifdef NEED_RLIM_T
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedoohtypedef int rlim_t;
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd/* Some versions of AIX support cross-process pthread mutexes; some don't. */
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#ifdef _POSIX_THREAD_PROCESS_SHARED
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define USE_PTHREAD_SERIALIZED_ACCEPT
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#else
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define USE_FCNTL_SERIALIZED_ACCEPT
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#ifdef USEBCOPY
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define memmove(a,b,c) bcopy(b,a,c)
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#if AIX >= 42
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NET_SIZE_T size_t
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#elif defined(ULTRIX)
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* we don't want to use sys/resource.h under
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd Ultrix although this header exists. */
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#undef HAVE_SYS_RESOURCE_H
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define HAVE_GMTOFF 1
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#undef NO_KILLPG
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef NO_SETSID
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define ULTRIX_BRAIN_DEATH
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NEED_STRDUP
6aada32e978e09cc60d52cb05ae4cee91b676da1slive/* If you have Ultrix 4.3, and are using cc, const is broken */
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
080b1313a70a1fc4b16d013c157fe17cf946def1wrowe#define const /* Not implemented */
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#endif
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#elif defined(OSF1)
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#define HAVE_GMTOFF 1
7a9bd2ef5b639208f2df638bcd34464ca6c86ae1humbedooh#undef NO_KILLPG
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef NO_SETSID
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_MMAP 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_MMAP_SCOREBOARD
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_MMAP_FILES
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define NO_LONG_DOUBLE
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_SYSLOG 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_FLOCK_SERIALIZED_ACCEPT
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
6aada32e978e09cc60d52cb05ae4cee91b676da1slive
fed984f5264bfdc7ccb8b5ee90c49c54102e4683slive#elif defined(PARAGON)
fed984f5264bfdc7ccb8b5ee90c49c54102e4683slive#define HAVE_GMTOFF 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#undef NO_KILLPG
dce4ff5d881d942f1ba7822d432eecd39f5166d2nd#undef NO_SETSID
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define HAVE_MMAP 1
6aada32e978e09cc60d52cb05ae4cee91b676da1slive#define USE_MMAP_SCOREBOARD
f1b61a479eb469248c50c5d62a884e255e5982f0yoshiki#define USE_MMAP_FILES
#define NO_LONG_DOUBLE
#define HAVE_SYSLOG 1
typedef int rlim_t;
#elif defined(SEQUENT)
#define DEFAULT_USER "nobody"
#define DEFAULT_GROUP "nobody"
#define NO_SHMGET 1
#define HAVE_MMAP 1
#define HAVE_SYSLOG 1
#define USE_MMAP_FILES 1
#define USE_MMAP_SCOREBOARD 1
#define USE_FCNTL_SERIALIZED_ACCEPT 1
#define JMP_BUF sigjmp_buf
#undef NO_SETSID
#if SEQUENT < 40
typedef int rlim_t;
#define NO_GETTIMEOFDAY
#undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
#include <sys/times.h>
#endif
#if SEQUENT < 42
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#endif
#if SEQUENT < 44
#define NO_KILLPG 1
#define NET_SIZE_T int
#endif
#if SEQUENT >= 44
#undef NO_KILLPG
#define NET_SIZE_T size_t
#endif
#elif defined(NEXT)
typedef unsigned short mode_t;
#define HAVE_GMTOFF 1
#undef NO_KILLPG
#define NO_SETSID
#define NEED_STRDUP
#define NO_LINGCLOSE
#undef _POSIX_SOURCE
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif
#ifndef S_ISDIR
#define S_ISDIR(m) (((m)&(S_IFMT)) == (S_IFDIR))
#endif
#ifndef S_ISREG
#define S_ISREG(m) (((m)&(S_IFMT)) == (S_IFREG))
#endif
#ifndef S_IXUSR
#define S_IXUSR 00100
#endif
#ifndef S_IRGRP
#define S_IRGRP 00040
#endif
#ifndef S_IXGRP
#define S_IXGRP 00010
#endif
#ifndef S_IROTH
#define S_IROTH 00004
#endif
#ifndef S_IXOTH
#define S_IXOTH 00001
#endif
#ifndef S_IRUSR
#define S_IRUSR S_IREAD
#endif
#ifndef S_IWUSR
#define S_IWUSR S_IWRITE
#endif
#ifndef S_IWGRP
#define S_IWGRP 000020
#endif
#ifndef S_IWOTH
#define S_IWOTH 000002
#endif
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
/* PR#2293 fix */
#define ap_wait_t union wait
#define waitpid(a,b,c) wait4((a) == -1 ? 0 : (a),(union wait *)(b),c,NULL)
#define WEXITSTATUS(status) (int)( WIFEXITED(status) ? ( (status).w_retcode ) : -1)
#define WTERMSIG(status) (int)( (status).w_termsig )
typedef int pid_t;
#define USE_LONGJMP
#define NO_USE_SIGACTION
#define HAVE_SYSLOG 1
#if defined(__DYNAMIC__)
#define HAVE_DYLD
#define DYLD_CANT_UNLOAD
#endif
#elif defined(MAC_OS) || defined(MAC_OS_X_SERVER) /* Mac OS (>= 10.0) and Mac OS X Server (<= 5.x) */
#undef PLATFORM
#ifdef MAC_OS_X_SERVER
#define PLATFORM "Mac OS X Server"
#else
#define PLATFORM "Mac OS"
#endif
#define HAVE_DYLD
#define HAVE_GMTOFF
#define HAVE_MMAP
#define USE_MMAP_FILES
#define USE_MMAP_SCOREBOARD
#ifdef MAC_OS_X_SERVER
#define MAP_TMPFILE
#endif /* MAC_OS_X_SERVER */
#define HAVE_RESOURCE
#define HAVE_SNPRINTF
#define JMP_BUF jmp_buf
#define USE_LONGJMP
#define USE_FLOCK_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
/*
* If you are using APACI, (you probably should be on Mac OS) these
* values are set at configure time.
*/
#ifndef HTTPD_ROOT
#define HTTPD_ROOT "/Local/Library/WebServer"
#endif
#ifndef DOCUMENT_LOCATION
#define DOCUMENT_LOCATION HTTPD_ROOT "/Documents"
#endif
#ifndef DEFAULT_XFERLOG
#define DEFAULT_XFERLOG "Logs/Access"
#endif
#ifndef DEFAULT_ERRORLOG
#define DEFAULT_ERRORLOG "Logs/Errors"
#endif
#ifndef DEFAULT_PIDLOG
#define DEFAULT_PIDLOG "Logs/Process"
#endif
#ifndef DEFAULT_SCOREBOARD
#define DEFAULT_SCOREBOARD "Logs/Status"
#endif
#ifndef DEFAULT_LOCKFILE
#define DEFAULT_LOCKFILE "Logs/Lock"
#endif
#ifndef SERVER_CONFIG_FILE
#define SERVER_CONFIG_FILE "Configuration/Server"
#endif
#ifndef TYPES_CONFIG_FILE
#define TYPES_CONFIG_FILE "Configuration/MIME"
#endif
#ifndef DEFAULT_USER_DIR
#define DEFAULT_USER_DIR "Library/Web Documents"
#endif
#ifndef DEFAULT_USER
#define DEFAULT_USER "www"
#endif
#ifndef DEFAULT_GROUP
#define DEFAULT_GROUP "www"
#endif
#ifndef DEFAULT_PATH
#define DEFAULT_PATH "/bin:/usr/bin:/usr/local/bin"
#endif
#elif defined(LINUX)
#if LINUX > 1
#include <features.h>
/* libc4 systems probably still work, it probably doesn't define
* __GNU_LIBRARY__
* libc5 systems define __GNU_LIBRARY__ == 1, but don't define __GLIBC__
* glibc 2.x and later systems define __GNU_LIBRARY__ == 6, but list it as
* "deprecated in favour of __GLIBC__"; the value 6 will never be changed.
* glibc 1.x systems (i.e. redhat 4.x on sparc/alpha) should have
* __GLIBC__ < 2
* all glibc based systems need crypt.h
*/
#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <crypt.h>
#endif
/* glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *
* there's no way to discern between these two libraries. But using int should
* be portable because otherwise these libs would be hopelessly broken with
* reams of existing networking code. We'll use socklen_t * for 2.1.x and
* later.
*
* int works for all the earlier libs, and is picked up by default later.
*/
#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
#define NET_SIZE_T socklen_t
#endif
#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#define HAVE_MMAP 1
#define USE_MMAP_FILES
/* flock is faster ... but hasn't been tested on 1.x systems */
/* PR#3531 indicates flock() may not be stable, probably depends on
* kernel version. Go back to using fcntl, but provide a way for
* folks to tweak their Configuration to get flock.
*/
#ifndef USE_FLOCK_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
#define SYS_SIGLIST _sys_siglist
#else
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
#include <sys/time.h>
#define HAVE_SYSLOG 1
/* glibc 2.1 and later finally define rlim_t */
#if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
typedef int rlim_t;
#endif
#elif defined(SCO)
#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#define NEED_INITGROUPS
#define NO_WRITEV
#include <sys/time.h>
#define HAVE_SYSLOG 1
#undef HAVE_SYS_RESOURCE_H
#elif defined(SCO5)
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define SecureWare
#define HAVE_SYSLOG 1
/* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
consts. Sigh. */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, unsigned);
#elif defined(AUX3)
/* These are to let -Wall compile more cleanly */
extern int strcasecmp(const char *, const char *);
extern int strncasecmp(const char *, const char *, unsigned);
extern int set42sig(), getopt(), getpeername(), bzero();
extern int listen(), bind(), socket(), getsockname();
extern int accept(), gethostname(), connect(), lstat();
extern int select(), killpg(), shutdown();
extern int initgroups(), setsockopt();
extern char *shmat();
extern int shmctl();
extern int shmget();
extern char *sbrk();
extern char *crypt();
#include <sys/time.h>
#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#define NEED_STRDUP
/* fcntl() locking is expensive with NFS */
#define USE_FLOCK_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
/*
* NOTE: If when you run Apache under A/UX and you get a warning
* that httpd couldn't move break, then the below value for
* MOVEBREAK (64megs) is too large for your setup. Try reducing
* to 0x2000000 which is still PLENTY of space. I doubt if
* even on heavy systems sbrk() would be called at all...
*/
#define MOVEBREAK 0x4000000
#define NO_LINGCLOSE
#define NO_SLACK
#define HAVE_SYSLOG 1
#undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
#elif defined(SVR4)
#define NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
#ifndef MPRAS
#define NEED_STRCASECMP
#ifndef ENCORE
#define NEED_STRNCASECMP
#endif /* ENCORE */
#endif /* MPRAS */
#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#ifndef USE_SYSVSEM_SERIALIZED_ACCEPT
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
#define HAVE_SYSLOG 1
#define NET_SIZE_T size_t
#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#ifdef _OSD_POSIX /* BS2000-POSIX mainframe needs initgroups */
#define NEED_HASHBANG_EMUL /* execve() doesn't start shell scripts by default */
#define _KMEMUSER /* Enable SHM_R/SHM_W defines in <shm.h> */
#undef NEED_STRCASECMP
#undef NEED_STRNCASECMP
#undef bzero
#endif /*_OSD_POSIX*/
#elif defined(UW)
#if UW < 700
#define USE_FCNTL_SERIALIZED_ACCEPT
#define NO_LINGCLOSE
#define NO_KILLPG
#endif
#undef NO_SETSID
#undef NEED_STRDUP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define bzero(a,b) memset(a,0,b)
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_SHMGET 1
#undef USE_SHMGET_SCOREBOARD /* force use of mmap() scoreboard */
#include <sys/time.h>
#if UW >= 200
#define _POSIX_SOURCE
#endif
#define NET_SIZE_T size_t
#define HAVE_SYSLOG 1
#elif defined(DGUX)
#define NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
#ifdef _IX86_DG
#undef NEED_STRCASECMP
#undef NEED_STRNCASECMP
#else
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#endif
#define bzero(a,b) memset(a,0,b)
/* A lot of SVR4 systems need this */
#define USE_FCNTL_SERIALIZED_ACCEPT
#define ap_inet_addr inet_network
#define HAVE_SYSLOG 1
#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(NETBSD)
#define HAVE_GMTOFF 1
#undef NO_KILLPG
#undef NO_SETSID
#define HAVE_SYSLOG 1
#ifndef DEFAULT_USER
#define DEFAULT_USER "nobody"
#endif
#ifndef DEFAULT_GROUP
#define DEFAULT_GROUP "nogroup"
#endif
#define HAVE_SHMGET 1
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define USE_FLOCK_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
#elif defined(UTS21)
#undef HAVE_GMTOFF
#undef NO_KILLPG
#define NO_SETSID
#define NEED_WAITPID
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#define HAVE_SYSLOG 1
#define USE_LONGJMP
#define JMP_BUF jmp_buf
#define NO_USE_SIGACTION
#define NEED_STRERROR
#define NEED_STRSTR
#define NEED_HASHBANG_EMUL
#define NDELAY_PIPE_RETURNS_ZERO
#define NO_DATA NO_ADDRESS
#define ap_wait_t union wait
#define WEXITSTATUS(status) (int)((status).w_retcode)
#define WTERMSIG(status) (int)((status).w_termsig)
#define strftime(buf,bufsize,fmt,tm) ascftime(buf,fmt,tm)
#undef HAVE_SYS_RESOURCE_H /* exists but does not provide *rlimit funcs */
#include <sys/types.h>
#include <sys/time.h>
#elif defined(APOLLO)
#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#define HAVE_SYSLOG 1
#elif defined(__FreeBSD__) || defined(__bsdi__)
#if defined(__FreeBSD__)
#include <osreldate.h>
#endif
#define HAVE_GMTOFF 1
#undef NO_KILLPG
#undef NO_SETSID
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#ifndef DEFAULT_USER
#define DEFAULT_USER "nobody"
#endif
#ifndef DEFAULT_GROUP
#define DEFAULT_GROUP "nogroup"
#endif
#if defined(__bsdi__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
typedef quad_t rlim_t;
#endif
#define USE_FLOCK_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
#define HAVE_SYSLOG 1
#define SYS_SIGLIST sys_siglist
#elif defined(QNX)
#ifndef crypt
char *crypt(const char *pw, const char *salt);
#endif
#ifndef initgroups
int initgroups(char *, int);
#endif
#ifndef strncasecmp
#define strncasecmp strnicmp
#endif
#undef NO_KILLPG
#undef NO_SETSID
#define NEED_INITGROUPS
#define NEED_SELECT_H
#define NEED_PROCESS_H
#include <unix.h>
#define HAVE_MMAP 1
#define USE_POSIX_SCOREBOARD
#define USE_FLOCK_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
#define HAVE_SYSLOG 1
#elif defined(LYNXOS)
#undef HAVE_GMTOFF
#undef USE_MMAP_SCOREBOARD
#undef USE_SHMGET_SCOREBOARD
#undef USE_FCNTL_SERIALIZED_ACCEPT
#undef USE_FLOCK_SERIALIZED_ACCEPT
#define USE_LONGJMP
#undef NO_KILLPG
#undef NO_SETSID
#undef NO_USE_SIGACTION
#undef NO_LINGCLOSE
extern char *crypt(char *pw, char *salt);
typedef int rlim_t;
#define HAVE_SYSLOG 1
#elif defined(UXPDS)
#undef NEED_STRCASECMP
#undef NEED_STRNCASECMP
#undef NEED_STRDUP
#undef HAVE_GMTOFF
#define NO_KILLPG
#undef NO_SETSID
#define bzero(a,b) memset(a,0,b)
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_SYSLOG 1
#elif defined(OS2)
/* Defines required for EMX OS/2 port. */
#define NO_KILLPG
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define NEED_PROCESS_H
#define NO_SETSID
#define NO_TIMES
#define CASE_BLIND_FILESYSTEM
/* Add some drive name support */
#define chdir _chdir2
#include <sys/time.h>
#define MAXSOCKETS 2048
#define USE_OS2_SCOREBOARD
#define NO_RELIABLE_PIPED_LOGS
#define USE_OS2SEM_SERIALIZED_ACCEPT
#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
#define NO_SLACK
#elif defined(__MACHTEN__)
typedef int rlim_t;
#undef NO_KILLPG
#define NO_SETSID
#define HAVE_GMTOFF 1
#ifndef __MACHTEN_PPC__
#ifndef __MACHTEN_68K__
#define __MACHTEN_68K__
#endif
#define USE_FLOCK_SERIALIZED_ACCEPT
#define NO_USE_SIGACTION
#define JMP_BUF sigjmp_buf
#define USE_LONGJMP
#undef NEED_STRDUP
#else
#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif
/* Convex OS v11 */
#elif defined(CONVEXOS11)
#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
#define HAVE_MMAP 1
#define USE_MMAP_SCOREBOARD
#define USE_MMAP_FILES
#define HAVE_SYSLOG 1
#define NO_TIMEZONE
#include <stdio.h>
#include <sys/types.h>
typedef int rlim_t;
#elif defined(ISC)
#include <net/errno.h>
#define NO_KILLPG
#undef NO_SETSID
#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#define USE_FCNTL_SERIALIZED_ACCEPT
#define HAVE_SYSLOG 1
#elif defined(NEWSOS)
#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#define USE_LONGJMP
#define NO_SETSID
#define NO_USE_SIGACTION
#define NEED_WAITPID
#define HAVE_SYSLOG 1
#include <sys/time.h>
#include <stdlib.h>
#include <sys/types.h>
typedef int pid_t;
typedef int rlim_t;
typedef int mode_t;
#elif defined(RISCIX)
#include <sys/time.h>
typedef int rlim_t;
#define NO_USE_SIGACTION
#define USE_LONGJMP
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#define NEED_STRDUP
#elif defined(BEOS)
#include <stddef.h>
#include <kernel/OS.h>
#include <kernel/image.h>
#include <sys/uio.h>
#define NO_WRITEV
#define NO_KILLPG
#define NEED_INITGROUPS
#elif defined(_CX_SX)
#define JMP_BUF sigjmp_buf
#include <sys/types.h>
#include <sys/time.h>
#elif defined(WIN32)
/* All windows stuff is now in os/win32/os.h */
#elif defined(TPF) /* IBM Transaction Processing Facility operating system */
#include <tpfeq.h>
#include <tpfio.h>
#include <sysapi.h>
#include <sysgtime.h>
#define PRIMECRAS 0x010000
#define JMP_BUF jmp_buf
#define HAVE_SHMGET
#undef HAVE_SYS_RESOURCE_H
#define NEED_INITGROUPS
#define NEED_SIGNAL_INTERRUPT
#include <strings.h>
#ifndef __strings_h
#define NEED_STRCASECMP
#define NEED_STRNCASECMP
#endif
#define NEED_STRDUP
#define NO_DBM_REWRITEMAP
#define NO_GETTIMEOFDAY
#define NO_KILLPG
#define NO_LINGCLOSE
#define NO_MMAP
#define NO_RELIABLE_PIPED_LOGS
#define NO_SETSID
#define NO_SLACK
#define NO_TIMES
#define NO_USE_SIGACTION
#define NO_WRITEV
#define USE_LONGJMP
/*#define USE_SHMGET_SCOREBOARD*/
#define USE_TPF_ACCEPT
#define USE_TPF_CORE_SERIALIZED_ACCEPT
/*#define USE_TPF_DAEMON*/
#define USE_TPF_SCOREBOARD
#define USE_TPF_SELECT
#undef offsetof
#define offsetof(s_type,field) ((size_t)&(((s_type*)0)->field))
#elif defined(__TANDEM)
#define NO_WRITEV
#define NO_KILLPG
#define NEED_INITGROUPS
#define NO_SLACK
#else
/* Unknown system - Edit these to match */
#ifdef BSD
#define HAVE_GMTOFF 1
#else
#undef HAVE_GMTOFF
#endif
/* NO_KILLPG is set on systems that don't have killpg */
#undef NO_KILLPG
/* NO_SETSID is set on systems that don't have setsid */
#undef NO_SETSID
/* NEED_STRDUP is set on stupid systems that don't have strdup. */
#undef NEED_STRDUP
#endif
/* stuff marked API_EXPORT is part of the API, and intended for use
* by modules
*/
#ifndef API_EXPORT
#define API_EXPORT(type) type
#endif
/* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
* use by modules. The difference between API_EXPORT and
* API_EXPORT_NONSTD is that the latter is required for any functions
* which use varargs or are used via indirect function call. This
* is to accomodate the two calling conventions in windows dlls.
*/
#ifndef API_EXPORT_NONSTD
#define API_EXPORT_NONSTD(type) type
#endif
#ifndef MODULE_VAR_EXPORT
#define MODULE_VAR_EXPORT
#endif
#ifndef API_VAR_EXPORT
#define API_VAR_EXPORT
#endif
/* modules should not used functions marked CORE_EXPORT
* or CORE_EXPORT_NONSTD */
#ifndef CORE_EXPORT
#define CORE_EXPORT API_EXPORT
#endif
#ifndef CORE_EXPORT_NONSTD
#define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
#endif
/* On Mac OS X Server, symbols that conflict with loaded dylibs
* (eg. System framework) need to be declared as private symbols with
* __private_extern__.
* For other systems, make that a no-op.
*/
#if (defined(MAC_OS) || defined(MAC_OS_X_SERVER)) && defined(__DYNAMIC__)
#define ap_private_extern __private_extern__
#else
#define ap_private_extern
#endif
/*
* The particular directory style your system supports. If you have dirent.h
* in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
* that file and define DIR_TYPE to be dirent. Otherwise, if you have
* /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
* file. If you have neither, I'm confused.
*/
#include <sys/types.h>
#include <stdarg.h>
#if !defined(NEXT) && !defined(WIN32)
#include <dirent.h>
#define DIR_TYPE dirent
#elif !defined(WIN32)
#include <sys/dir.h>
#define DIR_TYPE direct
#else
#define DIR_TYPE dirent
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __TANDEM
#include <strings.h>
#endif
#include "ap_ctype.h"
#if !defined(MPE) && !defined(WIN32) && !defined(TPF) && !defined(__TANDEM)
#include <sys/file.h>
#endif
#ifndef WIN32
#include <sys/socket.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
#ifndef TPF
#include <netinet/in.h>
#endif /* TPF */
#include <netdb.h>
#include <sys/ioctl.h>
#if !defined(MPE) && !defined(BEOS) && !defined(TPF)
#include <arpa/inet.h> /* for inet_ntoa */
#endif
#include <sys/wait.h>
#include <pwd.h>
#include <grp.h>
#include <fcntl.h>
#ifndef O_BINARY
#define O_BINARY (0)
#endif
#endif /* ndef WIN32 */
#include <limits.h>
#include <time.h> /* for ctime */
#ifdef WIN32
#define strftime(s,max,format,tm) os_strftime(s,max,format,tm)
#endif
#include <signal.h>
#if defined(TPF) && defined(NSIG)
#undef NSIG
#endif
#include <errno.h>
#if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT) && !defined(TPF)
#include <memory.h>
#endif
#ifdef NEED_PROCESS_H
#include <process.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#ifdef SUNOS4
int getrlimit(int, struct rlimit *);
int setrlimit(int, struct rlimit *);
#endif
#endif
#ifdef USE_MMAP_SCOREBOARD
#if !defined(OS2) && !defined(WIN32)
/* This file is not needed for OS/2 */
#include <sys/mman.h>
#endif
#endif
#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
#define MAP_ANON MAP_ANONYMOUS
#endif
#if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_FILES
#endif
#if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_SCOREBOARD
#endif
#if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) || !defined(HAVE_SHMGET))
#undef USE_SHMGET_SCOREBOARD
#endif
#ifndef LOGNAME_MAX
#define LOGNAME_MAX 25
#endif
#ifdef ultrix
#define ULTRIX_BRAIN_DEATH
#endif
#ifndef S_ISLNK
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif
#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned long) -1)
#endif
#include <setjmp.h>
#if defined(USE_LONGJMP)
#define ap_longjmp(x, y) longjmp((x), (y))
#define ap_setjmp(x) setjmp(x)
#ifndef JMP_BUF
#define JMP_BUF jmp_buf
#endif
#else
#define ap_longjmp(x, y) siglongjmp((x), (y))
#define ap_setjmp(x) sigsetjmp((x), 1)
#ifndef JMP_BUF
#define JMP_BUF sigjmp_buf
#endif
#endif
/* Majority of os's want to verify FD_SETSIZE */
#if !defined(WIN32) && !defined(TPF)
#define CHECK_FD_SETSIZE
#endif
#ifdef USE_TPF_SELECT
#define ap_select(_a, _b, _c, _d, _e) \
tpf_select(_a, _b, _c, _d, _e)
#elif defined(SELECT_NEEDS_CAST)
#define ap_select(_a, _b, _c, _d, _e) \
select((_a), (int *)(_b), (int *)(_c), (int *)(_d), (_e))
#elif defined(OS2)
int ap_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
#else
#define ap_select(_a, _b, _c, _d, _e) \
select(_a, _b, _c, _d, _e)
#endif
#ifdef NEED_SIGNAL_INTERRUPT
#define ap_check_signals() tpf_process_signals()
#else
#define ap_check_signals()
#endif
#ifdef ULTRIX_BRAIN_DEATH
#define ap_fdopen(d,m) fdopen((d), (char *)(m))
#else
#define ap_fdopen(d,m) fdopen((d), (m))
#endif
#ifndef ap_inet_addr
#define ap_inet_addr inet_addr
#endif
#ifndef HAS_OTHER_CHILD
#define NO_RELIABLE_PIPED_LOGS
#endif
/* When the underlying OS doesn't support exec() of scripts which start
* with a HASHBANG (#!) followed by interpreter name and args, define this.
*/
#ifdef NEED_HASHBANG_EMUL
extern int ap_execle(const char *filename, const char *arg,...);
extern int ap_execve(const char *filename, const char *argv[],
const char *envp[]);
/* ap_execle() is a wrapper function around ap_execve(). */
#define execle ap_execle
#define execve(path,argv,envp) ap_execve(path,argv,envp)
#endif
/* Finding offsets of elements within structures.
* Taken from the X code... they've sweated portability of this stuff
* so we don't have to. Sigh...
*/
#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
#ifdef __STDC__
#define XtOffset(p_type,field) _Offsetof(p_type,field)
#else
#ifdef CRAY2
#define XtOffset(p_type,field) \
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
#else /* !CRAY2 */
#define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
#endif /* !CRAY2 */
#endif /* __STDC__ */
#else /* ! (CRAY || __arm) */
#define XtOffset(p_type,field) \
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
#endif /* !CRAY */
#ifdef offsetof
#define XtOffsetOf(s_type,field) offsetof(s_type,field)
#else
#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
#endif
/*
* NET_SIZE_T exists because of shortsightedness on the POSIX committee. BSD
* systems used "int *" as the parameter to accept(), getsockname(),
* getpeername() et al. Consequently many unixes took an int * for that
* parameter. The POSIX committee decided that "int" was just too generic and
* had to be replaced with size_t almost everywhere. There's no problem with
* that when you're passing by value. But when you're passing by reference
* this creates a gross source incompatibility with existing programs. On
* 32-bit architectures it creates only a warning. On 64-bit architectures it
* creates broken code -- because "int *" is a pointer to a 64-bit quantity and
* "size_t *" is frequently a pointer to a 32-bit quantity.
*
* Some Unixes adopted "size_t *" for the sake of POSIX compliance. Others
* ignored it because it was such a broken interface. Chaos ensued. POSIX
* finally woke up and decided that it was wrong and created a new type
* socklen_t. The only useful value for socklen_t is int, and that's how
* everyone who has a clue implements it. It is almost always the case that
* NET_SIZE_T should be defined to be an int, unless the system being compiled
* for was created in the window of POSIX madness.
*/
#ifndef NET_SIZE_T
#define NET_SIZE_T int
#endif
/* Linux defines __WCOREDUMP, but doesn't define WCOREDUMP unless __USE_BSD
* is in use... we'd prefer to just use WCOREDUMP everywhere.
*/
#if defined(__WCOREDUMP) && !defined(WCOREDUMP)
#define WCOREDUMP __WCOREDUMP
#endif
#ifdef SUNOS_LIB_PROTOTYPES
/* Prototypes needed to get a clean compile with gcc -Wall.
* Believe it or not, these do have to be declared, at least on SunOS,
* because they aren't mentioned in the relevant system headers.
* Sun Quality Software. Gotta love it. This section is not
* currently (13Nov97) used.
*/
int getopt(int, char **, char *);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, int);
int toupper(int);
int tolower(int);
int printf(char *,...);
int fprintf(FILE *, char *,...);
int fputs(char *, FILE *);
int fread(char *, int, int, FILE *);
int fwrite(char *, int, int, FILE *);
int fgetc(FILE *);
char *fgets(char *s, int, FILE*);
int fflush(FILE *);
int fclose(FILE *);
int ungetc(int, FILE *);
int _filbuf(FILE *); /* !!! */
int _flsbuf(unsigned char, FILE *); /* !!! */
int sscanf(char *, char *,...);
void setbuf(FILE *, char *);
void perror(char *);
time_t time(time_t *);
int strftime(char *, int, const char *, struct tm *);
int initgroups(char *, int);
int wait3(int *, int, void *); /* Close enough for us... */
int lstat(const char *, struct stat *);
int stat(const char *, struct stat *);
int flock(int, int);
#ifndef NO_KILLPG
int killpg(int, int);
#endif
int socket(int, int, int);
int setsockopt(int, int, int, const char *, int);
int listen(int, int);
int bind(int, struct sockaddr *, int);
int connect(int, struct sockaddr *, int);
int accept(int, struct sockaddr *, int *);
int shutdown(int, int);
int getsockname(int s, struct sockaddr *name, int *namelen);
int getpeername(int s, struct sockaddr *name, int *namelen);
int gethostname(char *name, int namelen);
void syslog(int, char *,...);
char *mktemp(char *);
long vfprintf(FILE *, const char *, va_list);
#endif /* SUNOS_LIB_PROTOTYPES */
/*
* Transition macros from old-style configuration to autoconf
*/
#ifndef HAVE_CONFIG_H
#if !defined(NO_KILLPG) && !defined(HAVE_KILLPG)
#define HAVE_KILLPG
#endif
#if !defined(NEED_STRDUP) && !defined(HAVE_STRDUP)
#define HAVE_STRDUP
#endif
#if !defined(NEED_STRCASECMP) && !defined(HAVE_STRCASECMP)
#define HAVE_STRCASECMP
#endif
#if !defined(NEED_STRNCASECMP) && !defined(HAVE_STRNCASECMP)
#define HAVE_STRNCASECMP
#endif
#if !defined(NEED_STRSTR) && !defined(HAVE_STRSTR)
#define HAVE_STRSTR
#endif
#if !defined(NEED_INITGROUPS) && !defined(HAVE_INITGROUPS)
#define HAVE_INITGROUPS
#endif
#if !defined(NEED_WAITPID) && !defined(HAVE_WAITPID)
#define HAVE_WAITPID
#endif
#if !defined(NEED_STRERROR) && !defined(HAVE_STRERROR)
#define HAVE_STRERROR
#endif
#if !defined(NEED_DIFFTIME) && !defined(HAVE_DIFFTIME)
#define HAVE_DIFFTIME
#endif
#if !defined(NEED_GETTIMEOFDAY) && !defined(HAVE_GETTIMEOFDAY)
#define HAVE_GETTIMEOFDAY
#endif
#if !defined(NEED_SETSID) && !defined(HAVE_SETSID)
#define HAVE_SETSID
#endif
#if !defined(NO_TIMES) && !defined(HAVE_TIMES)
#define HAVE_TIMES
#define HAVE_SYS_TIMES_H
#endif
#if !defined(NO_RELIABLE_PIPED_LOGS)
#define HAVE_RELIABLE_PIPED_LOGS
#endif
#endif /* HAVE_CONFIG_H */
/* The assumption is that when the functions are missing,
* then there's no matching prototype available either.
* Declare what is needed exactly as the replacement routines implement it.
*/
#ifndef HAVE_STRDUP
extern char *strdup (const char *str);
#endif
#ifndef HAVE_STRCASECMP
extern int strcasecmp (const char *a, const char *b);
#endif
#ifndef HAVE_STRNCASECMP
extern int strncasecmp (const char *a, const char *b, int n);
#endif
#ifndef HAVE_INITGROUPS
extern int initgroups(const char *name, gid_t basegid);
#endif
#ifndef HAVE_WAITPID
extern int waitpid(pid_t pid, int *statusp, int options);
#endif
#ifndef HAVE_STRERROR
extern char *strerror (int err);
#endif
#ifndef HAVE_DIFFTIME
extern double difftime(time_t time1, time_t time0);
#endif
#ifndef ap_wait_t
#define ap_wait_t int
#endif
/*
* Special Support for User-Space Threading Environments [rse, 12-Aug-1999]
*/
/* optionally make sure the Pthread environment is available in _EVERY_ source
by including the Pthread header already in this header file. This is
important for portable user-space threading environments which can only use
soft syscall wrapping (i.e. ``#define read _pthread_read'', etc.) */
#ifdef PTHREAD_EVERYWHERE
#include <pthread.h>
#endif
/* support for forcing no serialized accept situation. This has to be
used by user-space threading environments, because mostly all (except for
USE_PTHREAD_SERIALIZED_ACCEPT, but this only works on a few platforms)
variants of the inter-process accept lock would suspend the whole process
and not just the acceptor thread. */
#ifdef NO_SERIALIZED_ACCEPT
#undef USE_FCNTL_SERIALIZED_ACCEPT
#undef USE_FLOCK_SERIALIZED_ACCEPT
#undef USE_USLOCK_SERIALIZED_ACCEPT
#undef USE_SYSVSEM_SERIALIZED_ACCEPT
#undef USE_PTHREAD_SERIALIZED_ACCEPT
#endif
#endif /* HAVE_CONFIG_H */
#ifdef __cplusplus
}
#endif
#endif /* !AP_CONFIG_H */