ap_config.inc 38 KB

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