home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Web / Servers / apache-1.2.4-MIHS / original-source / src / conf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-15  |  18.5 KB  |  761 lines

  1. /* ====================================================================
  2.  * Copyright (c) 1995-1997 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.
  24.  *
  25.  * 5. Redistributions of any form whatsoever must retain the following
  26.  *    acknowledgment:
  27.  *    "This product includes software developed by the Apache Group
  28.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  29.  *
  30.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  31.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  32.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  33.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  34.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  35.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  36.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  37.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  39.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  40.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  41.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  42.  * ====================================================================
  43.  *
  44.  * This software consists of voluntary contributions made by many
  45.  * individuals on behalf of the Apache Group and was originally based
  46.  * on public domain software written at the National Center for
  47.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  48.  * For more information on the Apache Group and the Apache HTTP server
  49.  * project, please see <http://www.apache.org/>.
  50.  *
  51.  */
  52.  
  53. /*
  54.  * conf.h: system-dependant #defines and includes...
  55.  * See README for a listing of what they mean
  56.  */
  57.  
  58. #if !defined(QNX) && !defined(MPE)
  59. #include <sys/param.h>
  60. #endif
  61.  
  62. /* Define one of these according to your system. */
  63. #if defined(MPE)
  64. #include <sys/times.h>
  65. #define JMP_BUF sigjmp_buf
  66. #define NO_SETSID
  67. #define NO_KILLPG
  68. #define NO_WRITEV
  69. #define NEED_INITGROUPS
  70. #define NEED_STRCASECMP
  71. #define NEED_STRDUP
  72. #define NEED_STRNCASECMP
  73. extern void GETPRIVMODE();
  74. extern void GETUSERMODE();
  75. extern char *inet_ntoa();
  76. #define NO_SLACK
  77.  
  78. #elif defined(SUNOS4)
  79. #define HAVE_GMTOFF
  80. #define HAVE_SYS_RESOURCE_H
  81. #undef NO_KILLPG
  82. #undef NO_SETSID
  83. char *crypt(const char *pw, const char *salt);
  84. char *mktemp(char *template);
  85. #define JMP_BUF sigjmp_buf
  86. #define HAVE_MMAP
  87. #include <sys/time.h>     
  88. #define NEED_STRERROR
  89. typedef int rlim_t;
  90. #define memmove(a,b,c) bcopy(b,a,c)
  91. #define NO_LINGCLOSE
  92. #define USE_FLOCK_SERIALIZED_ACCEPT
  93.  
  94. #elif defined(SOLARIS2)
  95. #undef HAVE_GMTOFF
  96. #define NO_KILLPG
  97. #undef NO_SETSID
  98. #define HAVE_SYS_RESOURCE_H
  99. #define bzero(a,b) memset(a,0,b)
  100. #define JMP_BUF sigjmp_buf
  101. #define USE_FCNTL_SERIALIZED_ACCEPT
  102. #define HAVE_MMAP
  103. #define HAVE_CRYPT_H
  104. int gethostname(char *name, int namelen);
  105.  
  106. #elif defined(IRIX)
  107. #undef HAVE_GMTOFF
  108. /* IRIX has killpg, but it's only in _BSD_COMPAT, so don't use it in case
  109.  * there's some weird conflict with non-BSD signals */
  110. #define NO_KILLPG
  111. #undef NO_SETSID
  112. #define JMP_BUF sigjmp_buf
  113. #define USE_FCNTL_SERIALIZED_ACCEPT
  114. #define HAVE_SHMGET
  115. #define HAVE_CRYPT_H
  116. #define NO_LONG_DOUBLE
  117. #define HAVE_BSTRING_H
  118. #define NO_LINGCLOSE
  119.  
  120. #elif defined(HIUX)
  121. #define HAVE_SYS_RESOURCE_H
  122. #undef HAVE_GMTOFF
  123. #define NO_KILLPG
  124. #undef NO_SETSID
  125. #ifndef _HIUX_SOURCE
  126. #define _HIUX_SOURCE
  127. #endif
  128. #define JMP_BUF sigjmp_buf
  129. #define HAVE_SHMGET
  130. #define SELECT_NEEDS_CAST
  131.  
  132. #elif defined(HPUX) || defined(HPUX10)
  133. #define HAVE_SYS_RESOURCE_H
  134. #undef HAVE_GMTOFF
  135. #define NO_KILLPG
  136. #undef NO_SETSID
  137. #ifndef _HPUX_SOURCE
  138. #define _HPUX_SOURCE
  139. #endif
  140. #define JMP_BUF sigjmp_buf
  141. #define HAVE_SHMGET
  142. #ifndef HPUX10
  143. #define SELECT_NEEDS_CAST
  144. typedef int rlim_t;
  145. #endif
  146.  
  147. #elif defined(AIX)
  148. #undef HAVE_GMTOFF
  149. #undef NO_KILLPG
  150. #undef NO_SETSID
  151. #define HAVE_SYS_SELECT_H
  152. #define JMP_BUF sigjmp_buf
  153. #ifndef __ps2__
  154. #define HAVE_MMAP
  155. #define DEFAULT_GROUP "nobody"
  156. #endif
  157. #define DEFAULT_USER "nobody"
  158. #ifdef NEED_RLIM_T
  159. typedef int rlim_t;
  160. #endif
  161.  
  162. #elif defined(ULTRIX)
  163. #define HAVE_GMTOFF
  164. #undef NO_KILLPG
  165. #undef NO_SETSID
  166. #define ULTRIX_BRAIN_DEATH
  167. #define NEED_STRDUP
  168. /* If you have Ultrix 4.3, and are using cc, const is broken */
  169. #ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
  170. #define const /* Not implemented */
  171. #endif
  172. #define JMP_BUF sigjmp_buf
  173.  
  174. #elif defined(OSF1)
  175. #define HAVE_GMTOFF
  176. #undef NO_KILLPG
  177. #undef NO_SETSID
  178. #define JMP_BUF sigjmp_buf
  179. #define HAVE_MMAP
  180. #define HAVE_CRYPT_H
  181. #define NO_LONG_DOUBLE
  182.  
  183. #elif defined(PARAGON)
  184. #define HAVE_GMTOFF
  185. #undef NO_KILLPG
  186. #undef NO_SETSID
  187. #define JMP_BUF sigjmp_buf
  188. #define HAVE_MMAP
  189. #define HAVE_CRYPT_H
  190. #define NO_LONG_DOUBLE
  191. typedef int rlim_t;
  192.  
  193. #elif defined(SEQUENT)
  194. #define HAVE_GMTOFF
  195. #undef NO_KILLPG
  196. #define NO_SETSID
  197. #define NEED_STRDUP
  198. #define tolower(c) (isupper(c) ? tolower(c) : c)
  199.  
  200. #elif defined(NEXT)
  201. typedef unsigned short mode_t;
  202. #define HAVE_GMTOFF
  203. #undef NO_KILLPG
  204. #define NO_SETSID
  205. #define NEED_STRDUP
  206. #define NO_LINGCLOSE
  207. #define NO_UNISTD_H
  208. #undef _POSIX_SOURCE
  209. #ifndef FD_CLOEXEC
  210. #define FD_CLOEXEC 1
  211. #endif
  212. #ifndef S_ISDIR
  213. #define S_ISDIR(m)      (((m)&(S_IFMT)) == (S_IFDIR))
  214. #endif
  215. #ifndef S_ISREG
  216. #define S_ISREG(m)      (((m)&(S_IFMT)) == (S_IFREG))
  217. #endif
  218. #ifndef S_IXUSR
  219. #define S_IXUSR 00100
  220. #endif
  221. #ifndef S_IRGRP
  222. #define S_IRGRP 00040
  223. #endif
  224. #ifndef S_IXGRP
  225. #define S_IXGRP 00010
  226. #endif
  227. #ifndef S_IROTH
  228. #define S_IROTH 00004
  229. #endif
  230. #ifndef S_IXOTH
  231. #define S_IXOTH 00001
  232. #endif
  233. #ifndef S_IRUSR
  234. #define S_IRUSR S_IREAD
  235. #endif
  236. #ifndef S_IWUSR
  237. #define S_IWUSR S_IWRITE
  238. #endif
  239. #ifndef S_IWGRP
  240. #define S_IWGRP    000020
  241. #endif
  242. #ifndef S_IWOTH
  243. #define S_IWOTH 000002
  244. #ifndef rlim_t
  245. typedef int rlim_t;
  246. #endif
  247. typedef u_long  n_long;
  248. #endif
  249.  
  250. #define STDIN_FILENO  0
  251. #define STDOUT_FILENO 1
  252. #define STDERR_FILENO 2
  253. #define waitpid(a,b,c) wait4((a) == -1 ? 0 : (a),(union wait *)(b),c,NULL)
  254. typedef int pid_t;
  255. #define JMP_BUF jmp_buf
  256. #define USE_LONGJMP
  257. #define NO_USE_SIGACTION
  258.  
  259. #elif defined(LINUX)
  260. #if LINUX > 1
  261. #define HAVE_SHMGET
  262. #define HAVE_SYS_RESOURCE_H
  263. typedef int rlim_t;
  264. #endif
  265. #define USE_FCNTL_SERIALIZED_ACCEPT
  266. #undef HAVE_GMTOFF
  267. #undef NO_KILLPG
  268. #undef NO_SETSID
  269. #undef NEED_STRDUP
  270. #define JMP_BUF sigjmp_buf
  271. #include <sys/time.h>     
  272.  
  273. #elif defined(SCO)
  274. #undef HAVE_GMTOFF
  275. #undef NO_KILLPG
  276. #undef NO_SETSID
  277. #define NEED_INITGROUPS
  278. #define NO_WRITEV
  279. #define JMP_BUF sigjmp_buf
  280. #define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */
  281. #include <sys/time.h>     
  282.  
  283. #elif defined(SCO5)
  284.  
  285. #define JMP_BUF sigjmp_buf
  286. #define SIGURG SIGUSR1
  287. #define HAVE_SYS_SELECT_H
  288. #define USE_FCNTL_SERIALIZED_ACCEPT
  289. #define HAVE_MMAP
  290. #define HAVE_SYS_RESOURCE_H
  291. #define SecureWare
  292.  
  293. /* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
  294. consts. Sigh. */
  295. extern int strcasecmp(const char *,const char *);
  296. extern int strncasecmp(const char *,const char *,unsigned);
  297.  
  298. #elif defined(AUX)
  299. /* These are to let -Wall compile more cleanly */
  300. extern int strcasecmp(const char *, const char *);
  301. extern int strncasecmp(const char *,const char *,unsigned);
  302. extern int set42sig(), getopt(), getpeername(), bzero();
  303. extern int listen(), bind(), socket(), getsockname();
  304. extern int accept(), gethostname(), connect(), lstat();
  305. extern int select(), killpg(), shutdown();
  306. extern int initgroups(), setsockopt();
  307. extern char *shmat();
  308. extern int  shmctl();
  309. extern int  shmget();
  310. extern char *sbrk();
  311. extern char *crypt();
  312. #include <sys/time.h>
  313. #undef HAVE_GMTOFF
  314. #undef NO_KILLPG
  315. #undef NO_SETSID
  316. #define NEED_STRDUP
  317. #define JMP_BUF sigjmp_buf
  318. /* fcntl() locking is expensive with NFS */
  319. #define USE_FLOCK_SERIALIZED_ACCEPT
  320. #define HAVE_SHMGET
  321. /*
  322.  * NOTE: If when you run Apache under A/UX and you get a warning
  323.  * that httpd couldn't move break, then the below value for
  324.  * MOVEBREAK (64megs) is too large for your setup. Try reducing
  325.  * to 0x2000000 which is still PLENTY of space. I doubt if
  326.  * even on heavy systems sbrk() would be called at all...
  327.  */
  328. #define MOVEBREAK        0x4000000
  329. #define NO_LINGCLOSE
  330. #define NO_SLACK
  331.  
  332. #elif defined(SVR4)
  333. #define NO_KILLPG
  334. #undef  NO_SETSID
  335. #undef NEED_STRDUP
  336. #define NEED_STRCASECMP
  337. #define NEED_STRNCASECMP
  338. #define bzero(a,b) memset(a,0,b)
  339. #define JMP_BUF sigjmp_buf
  340. /* A lot of SVR4 systems need this */
  341. #define USE_FCNTL_SERIALIZED_ACCEPT
  342.  
  343. #elif defined(UW)
  344. #define NO_LINGCLOSE
  345. #define NO_KILLPG
  346. #undef  NO_SETSID
  347. #undef NEED_STRDUP
  348. #define NEED_STRCASECMP
  349. #define NEED_STRNCASECMP
  350. #define bzero(a,b) memset(a,0,b)
  351. #define JMP_BUF sigjmp_buf
  352. #define HAVE_RESOURCE
  353. #define HAVE_MMAP
  354. #define HAVE_SHMGET
  355. #define HAVE_CRYPT_H
  356. #define HAVE_SYS_SELECT_H
  357. #define HAVE_SYS_RESOURCE_H
  358. #include <sys/time.h>
  359. #define _POSIX_SOURCE
  360.  
  361. #elif defined(DGUX)
  362. #define NO_KILLPG
  363. #undef  NO_SETSID
  364. #undef NEED_STRDUP
  365. #define NEED_STRCASECMP
  366. #define NEED_STRNCASECMP
  367. #define bzero(a,b) memset(a,0,b)
  368. #define JMP_BUF sigjmp_buf
  369. /* A lot of SVR4 systems need this */
  370. #define USE_FCNTL_SERIALIZED_ACCEPT
  371.  
  372. #elif defined(__NetBSD__) || defined(__OpenBSD__)
  373. #define HAVE_SYS_RESOURCE_H
  374. #define HAVE_GMTOFF
  375. #undef NO_KILLPG
  376. #undef NO_SETSID
  377. #define JMP_BUF sigjmp_buf
  378. #define DEFAULT_USER "nobody"
  379. #define DEFAULT_GROUP "nogroup"
  380.  
  381. #elif defined(UTS21)
  382. #undef HAVE_GMTOFF
  383. #undef NO_KILLPG
  384. #define NO_SETSID
  385. #define NEED_WAITPID
  386. #define STDIN_FILENO 0
  387. #define STDOUT_FILENO 1
  388. #define STDERR_FILENO 2
  389. #define strftime(buf,bufsize,fmt,tm)    ascftime(buf,fmt,tm)
  390. #include <sys/types.h>
  391.  
  392. #elif defined(APOLLO)
  393. #undef HAVE_GMTOFF
  394. #undef NO_KILLPG
  395. #undef NO_SETSID
  396.  
  397. #elif defined(__FreeBSD__) || defined(__bsdi__)
  398. #if defined(__FreeBSD__)
  399. #include <osreldate.h>
  400. #endif
  401. #define HAVE_SYS_RESOURCE_H
  402. #define HAVE_GMTOFF
  403. #undef NO_KILLPG
  404. #undef NO_SETSID
  405. #define JMP_BUF sigjmp_buf
  406. #define HAVE_MMAP
  407. #define DEFAULT_USER "nobody"
  408. #define DEFAULT_GROUP "nogroup"
  409. #if defined(__bsdi__) || \
  410. (defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
  411. typedef quad_t rlim_t;
  412. #endif
  413. #define USE_FLOCK_SERIALIZED_ACCEPT
  414.  
  415. #elif defined(QNX)
  416. #ifndef crypt
  417. char *crypt(const char *pw, const char *salt);
  418. #endif
  419. #ifndef initgroups
  420. int initgroups (char *, int);     
  421. #endif
  422. #ifndef strncasecmp
  423. #define strncasecmp strnicmp
  424. #endif
  425. #undef NO_KILLPG
  426. #undef NO_SETSID
  427. #define NEED_INITGROUPS
  428. #define NEED_SELECT_H
  429. #define NEED_PROCESS_H
  430. #define HAVE_SYS_SELECT_H
  431. #include <unix.h>
  432. #define JMP_BUF sigjmp_buf
  433.  
  434. #elif defined(LYNXOS)
  435. #undef NO_KILLPG
  436. #undef NO_SETSID
  437. #define NEED_STRCASECMP
  438. #define NEED_STRNCASECMP
  439. #define NEED_INITGROUPS
  440. #define JMP_BUF jmp_buf
  441.  
  442. #elif defined(UXPDS)
  443. #undef NEED_STRCASECMP
  444. #undef NEED_STRNCASECMP
  445. #undef NEED_STRDUP
  446. #undef HAVE_GMTOFF
  447. #define NO_KILLPG
  448. #undef NO_SETSID
  449. #define HAVE_RESOURCE 1
  450. #define bzero(a,b) memset(a,0,b)
  451. #define JMP_BUF sigjmp_buf
  452. #define USE_FCNTL_SERIALIZED_ACCEPT
  453. #define HAVE_MMAP
  454. #define HAVE_CRYPT_H
  455.  
  456. #elif defined(__EMX__)
  457. /* Defines required for EMX OS/2 port. */
  458. #define JMP_BUF sigjmp_buf
  459. #define NO_KILLPG
  460. #define NEED_STRCASECMP
  461. #define NEED_STRNCASECMP
  462. #define NO_SETSID
  463. /* Add some drive name support */
  464. #define chdir _chdir2
  465. #include <sys/time.h>     
  466. #define MAXSOCKETS 4096
  467. #define HAVE_MMAP
  468.     
  469. #elif defined(__MACHTEN__)
  470. typedef int rlim_t;
  471. #define JMP_BUF sigjmp_buf
  472. #undef NO_KILLPG
  473. #define NO_SETSID
  474. #define HAVE_GMTOFF
  475. #ifndef __MACHTEN_PPC__
  476. #ifndef __MACHTEN_68K__
  477. #define __MACHTEN_68K__
  478. #endif
  479. #define USE_FLOCK_SERIALIZED_ACCEPT
  480. #define NO_USE_SIGACTION
  481. #define USE_LONGJMP
  482. #undef NEED_STRDUP
  483. #else
  484. #define HAVE_SHMGET
  485. #define USE_FCNTL_SERIALIZED_ACCEPT
  486. #endif
  487.  
  488. /* Convex OS v11 */
  489. #elif defined(CONVEXOS11)
  490. #undef HAVE_GMTOFF
  491. #undef NO_KILLPG
  492. #undef NO_SETSID
  493. #undef NEED_STRDUP
  494. #define HAVE_MMAP
  495.  
  496. #define NO_TIMEZONE
  497. #include <stdio.h>
  498. #include <sys/types.h>
  499. #define JMP_BUF jmp_buf
  500. typedef int rlim_t;
  501.  
  502. #elif defined(ISC)
  503. #include <net/errno.h>     
  504. #define NO_KILLPG
  505. #undef NO_SETSID
  506. #define HAVE_SHMGET
  507. #define SIGURG SIGUSR1
  508. #define JMP_BUF sigjmp_buf
  509. #define USE_FCNTL_SERIALIZED_ACCEPT
  510.  
  511. /* Unknown system - Edit these to match */
  512. #else
  513. #ifdef BSD
  514. #define HAVE_GMTOFF
  515. #else
  516. #undef HAVE_GMTOFF
  517. #endif
  518. /* NO_KILLPG is set on systems that don't have killpg */
  519. #undef NO_KILLPG
  520. /* NO_SETSID is set on systems that don't have setsid */
  521. #undef NO_SETSID
  522. /* NEED_STRDUP is set on stupid systems that don't have strdup. */
  523. #undef NEED_STRDUP
  524. #endif
  525.  
  526. /* Do we have sys/resource.h; assume that BSD does. */
  527. #ifndef HAVE_SYS_RESOURCE_H
  528. #ifdef BSD
  529. #define HAVE_SYS_RESOURCE_H
  530. #endif
  531. #endif /* HAVE_SYS_RESOURCE_H */
  532.  
  533. /*
  534.  * The particular directory style your system supports. If you have dirent.h
  535.  * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include 
  536.  * that file and define DIR_TYPE to be dirent. Otherwise, if you have 
  537.  * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
  538.  * file. If you have neither, I'm confused.
  539.  */
  540.  
  541. #include <sys/types.h>
  542. #include <stdarg.h>
  543. /*
  544.  * We use snprintf() to avoid overflows, but we include
  545.  * our own version (ap_snprintf). Allow for people to use their
  546.  * snprintf() if they want
  547.  */
  548. #ifdef HAVE_SNPRINTF
  549. #define ap_snprintf     snprintf
  550. #define ap_vsnprintf    vsnprintf
  551. #else
  552. int ap_snprintf(char *buf, size_t len, const char *format,...);
  553. int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap);
  554. #endif
  555.  
  556. #if !defined(NEXT)
  557. #include <dirent.h>
  558. #define DIR_TYPE dirent
  559. #else
  560. #include <sys/dir.h>
  561. #define DIR_TYPE direct
  562. #endif
  563.  
  564. #include <stdio.h>
  565. #include <stdlib.h>
  566. #include <string.h>
  567. #include <sys/stat.h>
  568. #ifndef MPE
  569. #include <sys/file.h>
  570. #endif
  571. #include <sys/socket.h>
  572. #ifdef HAVE_SYS_SELECT_H
  573. #include <sys/select.h>
  574. #endif
  575. #include <ctype.h>
  576. #include <netinet/in.h>
  577. #include <netdb.h>
  578. #include <sys/ioctl.h>
  579. #ifndef MPE
  580. #include <arpa/inet.h>  /* for inet_ntoa */
  581. #endif
  582. #include <time.h>  /* for ctime */
  583. #include <signal.h>
  584. #include <errno.h>
  585. #include <sys/wait.h>
  586. #include <pwd.h>
  587. #include <grp.h>
  588. #include <fcntl.h>
  589. #include <limits.h>
  590. #if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT)
  591. #include <memory.h>
  592. #endif
  593. #ifdef NEED_PROCESS_H
  594. #include <process.h>
  595. #endif
  596.  
  597. #include <regex.h>
  598.  
  599. #ifdef HAVE_SYS_RESOURCE_H
  600. #include <sys/resource.h>
  601. #ifdef SUNOS4
  602. int getrlimit( int, struct rlimit *);
  603. int setrlimit( int, struct rlimit *);
  604. #endif
  605. #endif
  606. #ifdef HAVE_MMAP
  607. #ifndef __EMX__
  608. /* This file is not needed for OS/2 */
  609. #include <sys/mman.h>
  610. #endif
  611. #endif
  612. #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
  613. #define MAP_ANON MAP_ANONYMOUS
  614. #endif
  615.  
  616. #if defined(HAVE_MMAP) && defined(NO_MMAP)
  617. #undef HAVE_MMAP
  618. #endif
  619.  
  620. #ifndef LOGNAME_MAX
  621. #define LOGNAME_MAX 25
  622. #endif
  623.  
  624. #ifndef NEXT
  625. #include <unistd.h>
  626. #endif
  627.  
  628. #ifdef ultrix
  629. #define ULTRIX_BRAIN_DEATH
  630. #endif
  631.  
  632. #ifndef S_ISLNK
  633. #ifndef __EMX__
  634. /* Don't define this for OS/2 */
  635. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  636. #endif
  637. #endif
  638.  
  639. #ifndef INADDR_NONE
  640. #define INADDR_NONE ((unsigned long) -1)
  641. #endif
  642.  
  643. /*
  644.  * Replace signal function with sigaction equivalent
  645.  */
  646. #ifndef NO_USE_SIGACTION
  647. typedef void Sigfunc(int);
  648.  
  649. #if defined(SIG_IGN) && !defined(SIG_ERR)
  650. #define SIG_ERR ((Sigfunc *)-1)
  651. #endif
  652.  
  653. /*
  654.  * For some strange reason, QNX defines signal to signal. Eliminate it.
  655.  */
  656. #ifdef signal
  657. #undef signal
  658. #endif
  659. #define signal(s,f)    ap_signal(s,f)
  660. Sigfunc *signal(int signo, Sigfunc *func);
  661. #endif
  662.  
  663. #include <setjmp.h>
  664.  
  665. #if defined(USE_LONGJMP)
  666. #define ap_longjmp(x, y)        longjmp((x), (y))
  667. #define ap_setjmp(x)            setjmp(x)
  668. #else
  669. #define ap_longjmp(x, y)        siglongjmp((x), (y))
  670. #define ap_setjmp(x)            sigsetjmp((x), 1)
  671. #endif
  672.  
  673. /* Finding offsets of elements within structures.
  674.  * Taken from the X code... they've sweated portability of this stuff
  675.  * so we don't have to.  Sigh...
  676.  */
  677.  
  678. #if defined(CRAY) || defined(__arm)
  679. #if __STDC__
  680. #define XtOffset(p_type,field) _Offsetof(p_type,field)
  681. #else
  682. #ifdef CRAY2
  683. #define XtOffset(p_type,field) \
  684.     (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
  685.  
  686. #else    /* !CRAY2 */
  687.  
  688. #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
  689.  
  690. #endif    /* !CRAY2 */
  691. #endif  /* __STDC__ */
  692. #else    /* ! (CRAY || __arm) */
  693.  
  694. #define XtOffset(p_type,field) \
  695.     ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
  696.  
  697. #endif /* !CRAY */
  698.  
  699. #ifdef offsetof
  700. #define XtOffsetOf(s_type,field) offsetof(s_type,field)
  701. #else
  702. #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
  703. #endif
  704.  
  705. #ifdef SUNOS_LIB_PROTOTYPES
  706. /* Prototypes needed to get a clean compile with gcc -Wall.
  707.  * Believe it or not, these do have to be declared, at least on SunOS,
  708.  * because they aren't mentioned in the relevant system headers.
  709.  * Sun Quality Software.  Gotta love it.
  710.  */
  711.  
  712. int getopt (int, char **, char *);
  713.  
  714. int strcasecmp (char *, char *);
  715. int strncasecmp (char *, char *, int);
  716. int toupper(int);
  717. int tolower(int);     
  718.      
  719. int printf (char *, ...);     
  720. int fprintf (FILE *, char *, ...);
  721. int fputs (char *, FILE *);
  722. int fread (char *, int, int, FILE *);     
  723. int fwrite (char *, int, int, FILE *);     
  724. int fflush (FILE *);
  725. int fclose (FILE *);
  726. int ungetc (int, FILE *);
  727. int _filbuf (FILE *);        /* !!! */
  728. int _flsbuf (unsigned char, FILE *); /* !!! */
  729. int sscanf (char *, char *, ...);
  730. void setbuf (FILE *, char *);
  731. void perror (char *);
  732.      
  733. time_t time (time_t *);
  734. int strftime (char *, int, char *, struct tm *);
  735.      
  736. int initgroups (char *, int);     
  737. int wait3 (int *, int, void*);    /* Close enough for us... */
  738. int lstat (const char *, struct stat *);
  739. int stat (const char *, struct stat *);     
  740. int flock (int, int);
  741. #ifndef NO_KILLPG
  742. int killpg(int, int);
  743. #endif
  744. int socket (int, int, int);     
  745. int setsockopt (int, int, int, const char*, int);
  746. int listen (int, int);     
  747. int bind (int, struct sockaddr *, int);     
  748. int connect (int, struct sockaddr *, int);
  749. int accept (int, struct sockaddr *, int *);
  750. int shutdown (int, int);     
  751.  
  752. int getsockname (int s, struct sockaddr *name, int *namelen);
  753. int getpeername (int s, struct sockaddr *name, int *namelen);
  754. int gethostname (char *name, int namelen);     
  755. void syslog (int, char *, ...);
  756. char *mktemp (char *);
  757.      
  758. long vfprintf (FILE *, char *, va_list);
  759.      
  760. #endif
  761.