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