ap_config.inc 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496
  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. #undef PLATFORM
  804. #define PLATFORM "BeOS"
  805. #include <stddef.h>
  806. #include <kernel/OS.h>
  807. #define HAVE_BEOS_SERIALIZED_ACCEPT
  808. #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  809. #define NO_WRITEV
  810. #define NO_KILLPG
  811. #define NEED_INITGROUPS
  812. #define PF_INET AF_INET
  813. #define S_IEXEC S_IXUSR
  814. {$else}{$if defined(BONE)}
  815. #undef PLATFORM
  816. #define PLATFORM "BeOS BONE"
  817. #include <kernel/OS.h>
  818. #define NO_KILLPG
  819. #define NEED_INITGROUPS
  820. #define S_IEXEC S_IXUSR
  821. #define HAVE_BEOS_SERIALIZED_ACCEPT
  822. #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  823. {$else}{$if defined(_CX_SX)}
  824. #define JMP_BUF sigjmp_buf
  825. #include <sys/types.h>
  826. #include <sys/time.h>
  827. {$else}{$if defined(WINDOWS)}
  828. { All windows stuff is now in os/win32/os.h }
  829. {$include win32_os.inc}
  830. {$else}{$if defined(TPF)} { IBM Transaction Processing Facility operating system }
  831. { All TPF definitions are now in os/tpf/os.h }
  832. {$else}{$if defined(__TANDEM)}
  833. #define NO_WRITEV
  834. #define NO_KILLPG
  835. #define NEED_INITGROUPS
  836. #define NO_SLACK
  837. {$else}{$if defined(OS390)} { IBM OS/390 Operating System }
  838. #define HAVE_MMAP
  839. #define HAVE_SHMGET
  840. #define USE_SHMGET_SCOREBOARD
  841. #define USE_MMAP_FILES
  842. #define NEED_UNION_SEMUN
  843. #define HAVE_SYSVSEM_SERIALIZED_ACCEPT
  844. #define HAVE_FCNTL_SERIALIZED_ACCEPT
  845. #define _POSIX_SOURCE
  846. #include <signal.h>
  847. #ifdef SIGDUMP { SIGDUMP is not defined by OS/390 v1r2 }
  848. #define NSIG SIGDUMP+1
  849. #else
  850. #define NSIG 40
  851. #endif
  852. #define JMP_BUF sigjmp_buf
  853. #define _XOPEN_SOURCE_EXTENDED 1
  854. #define _OPEN_MSGQ_EXT
  855. #define _XOPEN_SOURCE
  856. #define SHM_R S_IRUSR
  857. #define SHM_W S_IWUSR
  858. #include <sys/time.h>
  859. #include <sys/types.h>
  860. #include <sys/msg.h>
  861. #include <sys/socket.h>
  862. #define NET_SIZE_T size_t
  863. #define NEED_HASHBANG_EMUL
  864. #define NONBLOCK_WHEN_MULTI_LISTEN
  865. {$else}{$if defined(CYGWIN)} { Cygwin 1.x POSIX layer for Win32 }
  866. #define SYSTEM_UID 18
  867. #define JMP_BUF jmp_buf
  868. #define NO_KILLPG
  869. #define NO_SETSID
  870. #define USE_LONGJMP
  871. #define GDBM_STATIC
  872. #define HAVE_MMAP 1
  873. #define USE_MMAP_SCOREBOARD
  874. #define USE_MMAP_FILES
  875. #define HAVE_SYSLOG 1
  876. #define HAVE_FCNTL_SERIALIZED_ACCEPT
  877. #define HAVE_PTHREAD_SERIALIZED_ACCEPT
  878. #define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  879. #if !defined(USE_FCNTL_SERIALIZED_ACCEPT)
  880. #define USE_PTHREAD_SERIALIZED_ACCEPT
  881. #endif
  882. {$else}{$if defined(NETWARE)}
  883. #define NONBLOCK_WHEN_MULTI_LISTEN
  884. {$else}
  885. { Unknown system - Edit these to match }
  886. {$ifdef BSD}
  887. {$define HAVE_GMTOFF}
  888. {$else}
  889. {$undefine HAVE_GMTOFF}
  890. {$endif}
  891. { NO_KILLPG is set on systems that don't have killpg }
  892. {$undefine NO_KILLPG}
  893. { NO_SETSID is set on systems that don't have setsid }
  894. {$undefine NO_SETSID}
  895. { NEED_STRDUP is set on stupid systems that don't have strdup. }
  896. {$undefine NEED_STRDUP}
  897. {$endif}
  898. {$endif}
  899. {$endif}
  900. {$endif}
  901. {$endif}
  902. {$endif}
  903. {$endif}
  904. {$endif}
  905. {$endif}
  906. {$endif}
  907. {$endif}
  908. {$endif}
  909. {$endif}
  910. {$endif}
  911. {$endif}
  912. {$endif}
  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. //#ifdef HAVE_SYS_PARAM_H
  943. //#include <sys/param.h>
  944. //#endif { HAVE_SYS_PARAM_H }
  945. { stuff marked API_EXPORT is part of the API, and intended for use
  946. * by modules
  947. }
  948. //#ifndef API_EXPORT
  949. //#define API_EXPORT(type) type
  950. //#endif
  951. { Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
  952. * use by modules. The difference between API_EXPORT and
  953. * API_EXPORT_NONSTD is that the latter is required for any functions
  954. * which use varargs or are used via indirect function call. This
  955. * is to accomodate the two calling conventions in windows dlls.
  956. }
  957. {#ifndef API_EXPORT_NONSTD
  958. #define API_EXPORT_NONSTD(type) type
  959. #endif
  960. #ifndef MODULE_VAR_EXPORT
  961. #define MODULE_VAR_EXPORT
  962. #endif
  963. #ifndef API_VAR_EXPORT
  964. #define API_VAR_EXPORT
  965. #endi}
  966. { modules should not used functions marked CORE_EXPORT
  967. * or CORE_EXPORT_NONSTD }
  968. {#ifndef CORE_EXPORT
  969. #define CORE_EXPORT API_EXPORT
  970. #endif
  971. #ifndef CORE_EXPORT_NONSTD
  972. #define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
  973. #endif
  974. }
  975. { On Darwin, symbols that conflict with loaded dylibs
  976. * (eg. System framework) need to be declared as private symbols with
  977. * __private_extern__.
  978. * For other systems, make that a no-op.
  979. }
  980. {#if defined(DARWIN) && defined(__DYNAMIC__)
  981. #define ap_private_extern __private_extern__
  982. #else
  983. #define ap_private_extern
  984. #endif}
  985. {
  986. * The particular directory style your system supports. If you have dirent.h
  987. * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
  988. * that file and define DIR_TYPE to be dirent. Otherwise, if you have
  989. * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
  990. * file. If you have neither, I'm confused.
  991. }
  992. {#ifndef NETWARE
  993. #include <sys/types.h>
  994. #endif
  995. #include <stdarg.h>}
  996. {#if !defined(NEXT) && !defined(WIN32)
  997. #include <dirent.h>
  998. #define DIR_TYPE dirent
  999. #elif !defined(WIN32)
  1000. #include <sys/dir.h>
  1001. #define DIR_TYPE direct
  1002. #else
  1003. #define DIR_TYPE dirent
  1004. #endif
  1005. #include <stdio.h>
  1006. #include <stdlib.h>
  1007. #include <string.h>
  1008. #ifdef __TANDEM
  1009. #include <strings.h>
  1010. #endif
  1011. #include "ap_ctype.h"
  1012. #if !defined(MPE) && !defined(WIN32) && !defined(TPF41) && !defined(__TANDEM) && !defined(NETWARE)
  1013. #include <sys/file.h>
  1014. #endif
  1015. #if !defined(WIN32) && !defined(NETWARE)
  1016. #include <sys/socket.h>
  1017. #ifdef HAVE_SYS_SELECT_H
  1018. #include <sys/select.h>
  1019. #endif }{ HAVE_SYS_SELECT_H }
  1020. {#ifndef TPF41
  1021. #include <netinet/in.h>
  1022. #endif }{ ndef TPF41 }
  1023. {#if defined(OS390) && !defined(NO_ADDRESS)
  1024. #define NO_ADDRESS NO_DATA } { Not defined properly by OS/390 v1r2 }
  1025. {#endif
  1026. #include <netdb.h>
  1027. #include <sys/ioctl.h>
  1028. #if !defined(MPE) && !defined(BEOS) && !defined(TPF41)
  1029. #include <arpa/inet.h> }{ for inet_ntoa }
  1030. {#endif
  1031. #include <sys/wait.h>
  1032. #include <pwd.h>
  1033. #include <grp.h>
  1034. #include <fcntl.h>
  1035. #ifndef BEOS
  1036. #define closesocket(s) close(s)
  1037. #endif
  1038. #ifndef O_BINARY
  1039. #define O_BINARY (0)
  1040. #endif
  1041. #endif }{ ndef WIN32 }
  1042. {#include <limits.h>
  1043. #include <time.h>} { for ctime }
  1044. {#ifdef WIN32
  1045. #define strftime(s,max,format,tm) os_strftime(s,max,format,tm)
  1046. #endif
  1047. #include <signal.h>
  1048. #ifdef NETWARE
  1049. #undef SIGKILL
  1050. #undef SA_NOCLDSTOP
  1051. #undef SIGALRM
  1052. #undef SIGCHILD
  1053. #undef SIGCONT
  1054. #undef SIGHUP
  1055. #undef SIGPIPE
  1056. #undef SIGQUIT
  1057. #undef SIGSTOP
  1058. #undef SIGTSTP
  1059. #undef SIGTTIN
  1060. #undef SIGTTOU
  1061. #undef SIGUSR1
  1062. #undef SIGUSR2
  1063. #undef SIG_BLOCK
  1064. #undef SIG_SETMASK
  1065. #undef SIG_UNBLOCK
  1066. #endif
  1067. #if defined(TPF41) && defined(NSIG)
  1068. #undef NSIG
  1069. #endif
  1070. #include <errno.h>
  1071. #if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT) && !defined(TPF41) && !defined(NETWARE) && !defined(MPE)
  1072. #include <memory.h>
  1073. #endif
  1074. #ifdef NEED_PROCESS_H
  1075. #include <process.h>
  1076. #endif}
  1077. {#if defined(WIN32) || defined(USE_HSREGEX)
  1078. #include "hsregex.h"
  1079. #else
  1080. #include <regex.h>
  1081. #endif}
  1082. {$include hsregex.inc}
  1083. {#ifdef HAVE_SYS_RESOURCE_H
  1084. #include <sys/resource.h>
  1085. #ifdef SUNOS4
  1086. int getrlimit(int, struct rlimit *);
  1087. int setrlimit(int, struct rlimit *);
  1088. #endif
  1089. #endif
  1090. #ifdef USE_MMAP_SCOREBOARD
  1091. #if !defined(OS2) && !defined(WIN32)}
  1092. { This file is not needed for OS/2 }
  1093. {#include <sys/mman.h>
  1094. #endif
  1095. #endif
  1096. #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
  1097. #define MAP_ANON MAP_ANONYMOUS
  1098. #endif
  1099. #if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
  1100. #undef USE_MMAP_FILES
  1101. #endif
  1102. #if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
  1103. #undef USE_MMAP_SCOREBOARD
  1104. #endif
  1105. #if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) || !defined(HAVE_SHMGET))
  1106. #undef USE_SHMGET_SCOREBOARD
  1107. #endif}
  1108. { A USE_FOO_SERIALIZED_ACCEPT implies a HAVE_FOO_SERIALIZED_ACCEPT }
  1109. {#if defined(USE_USLOCK_SERIALIZED_ACCEPT) && !defined(HAVE_USLOCK_SERIALIZED_ACCEPT)
  1110. #define HAVE_USLOCK_SERIALIZED_ACCEPT
  1111. #endif
  1112. #if defined(USE_PTHREAD_SERIALIZED_ACCEPT) && !defined(HAVE_PTHREAD_SERIALIZED_ACCEPT)
  1113. #define HAVE_PTHREAD_SERIALIZED_ACCEPT
  1114. #endif
  1115. #if defined(USE_SYSVSEM_SERIALIZED_ACCEPT) && !defined(HAVE_SYSVSEM_SERIALIZED_ACCEPT)
  1116. #define HAVE_SYSVSEM_SERIALIZED_ACCEPT
  1117. #endif
  1118. #if defined(USE_FCNTL_SERIALIZED_ACCEPT) && !defined(HAVE_FCNTL_SERIALIZED_ACCEPT)
  1119. #define HAVE_FCNTL_SERIALIZED_ACCEPT
  1120. #endif
  1121. #if defined(USE_FLOCK_SERIALIZED_ACCEPT) && !defined(HAVE_FLOCK_SERIALIZED_ACCEPT)
  1122. #define HAVE_FLOCK_SERIALIZED_ACCEPT
  1123. #endif
  1124. #if defined(USE_OS2SEM_SERIALIZED_ACCEPT) && !defined(HAVE_OS2SEM_SERIALIZED_ACCEPT)
  1125. #define HAVE_OS2SEM_SERIALIZED_ACCEPT
  1126. #endif
  1127. #if defined(USE_TPF_CORE_SERIALIZED_ACCEPT) && !defined(HAVE_TPF_CORE_SERIALIZED_ACCEPT)
  1128. #define HAVE_TPF_CORE_SERIALIZED_ACCEPT
  1129. #endif
  1130. #if defined(USE_BEOS_SERIALIZED_ACCEPT) && !defined(HAVE_BEOS_SERIALIZED_ACCEPT)
  1131. #define HAVE_BEOS_SERIALIZED_ACCEPT
  1132. #endif
  1133. #if defined(USE_NONE_SERIALIZED_ACCEPT) && !defined(HAVE_NONE_SERIALIZED_ACCEPT)
  1134. #define HAVE_NONE_SERIALIZED_ACCEPT
  1135. #endif}
  1136. LOGNAME_MAX = 25;
  1137. //#ifdef HAVE_UNISTD_H
  1138. //#include <unistd.h>
  1139. //#endif
  1140. //#ifdef ultrix
  1141. //#define ULTRIX_BRAIN_DEATH
  1142. //#endif
  1143. {#ifndef S_ISLNK
  1144. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  1145. #endif
  1146. #ifndef INADDR_NONE
  1147. #define INADDR_NONE ((unsigned long) -1)
  1148. #endif}
  1149. {
  1150. * Replace signal function with sigaction equivalent
  1151. }
  1152. {#ifndef NO_USE_SIGACTION
  1153. typedef void Sigfunc(int);
  1154. #if defined(SIG_IGN) && !defined(SIG_ERR)
  1155. #define SIG_ERR ((Sigfunc *)-1)
  1156. #endif}
  1157. {
  1158. * For some strange reason, QNX defines signal to signal. Eliminate it.
  1159. }
  1160. {#ifdef signal
  1161. #undef signal
  1162. #endif
  1163. #define signal(s,f) ap_signal(s,f)
  1164. Sigfunc *signal(int signo, Sigfunc * func);
  1165. #endif
  1166. #include <setjmp.h>
  1167. #if defined(USE_LONGJMP)
  1168. #define ap_longjmp(x, y) longjmp((x), (y))
  1169. #define ap_setjmp(x) setjmp(x)
  1170. #ifndef JMP_BUF
  1171. #define JMP_BUF jmp_buf
  1172. #endif
  1173. #else
  1174. #define ap_longjmp(x, y) siglongjmp((x), (y))
  1175. #define ap_setjmp(x) sigsetjmp((x), 1)
  1176. #ifndef JMP_BUF
  1177. #define JMP_BUF sigjmp_buf
  1178. #endif
  1179. #endif}
  1180. { Majority of os's want to verify FD_SETSIZE }
  1181. {#if !defined(WIN32) && !defined(TPF) && !defined(NETWARE)
  1182. #define CHECK_FD_SETSIZE
  1183. #endif
  1184. #ifdef USE_TPF_SELECT
  1185. #define ap_select(_a, _b, _c, _d, _e) \
  1186. tpf_select(_a, _b, _c, _d, _e)
  1187. #elif defined(SELECT_NEEDS_CAST)
  1188. #define ap_select(_a, _b, _c, _d, _e) \
  1189. select((_a), (int *)(_b), (int *)(_c), (int *)(_d), (_e))
  1190. #else
  1191. #define ap_select(_a, _b, _c, _d, _e) \
  1192. select(_a, _b, _c, _d, _e)
  1193. #endif
  1194. #ifdef USE_TPF_ACCEPT
  1195. #define ap_accept(_fd, _sa, _ln) tpf_accept(_fd, _sa, _ln)
  1196. #else
  1197. #define ap_accept(_fd, _sa, _ln) accept(_fd, _sa, _ln)
  1198. #endif
  1199. #ifdef NEED_SIGNAL_INTERRUPT
  1200. #define ap_check_signals() tpf_process_signals()
  1201. #else
  1202. #define ap_check_signals()
  1203. #endif
  1204. #ifdef ULTRIX_BRAIN_DEATH
  1205. #define ap_fdopen(d,m) fdopen((d), (char *)(m))
  1206. #else
  1207. #define ap_fdopen(d,m) fdopen((d), (m))
  1208. #endif
  1209. #ifndef ap_inet_addr
  1210. #define ap_inet_addr inet_addr
  1211. #endif
  1212. #ifdef NO_OTHER_CHILD
  1213. #define NO_RELIABLE_PIPED_LOGS
  1214. #endif}
  1215. { When the underlying OS doesn't support exec() of scripts which start
  1216. * with a HASHBANG (#!) followed by interpreter name and args, define this.
  1217. }
  1218. {#ifdef NEED_HASHBANG_EMUL
  1219. extern int ap_execle(const char *filename, const char *arg,...);
  1220. extern int ap_execve(const char *filename, char * const argv[],
  1221. char * const envp[]);}
  1222. { ap_execle() is a wrapper function around ap_execve(). }
  1223. {#define execle ap_execle
  1224. #define execve(path,argv,envp) ap_execve(path,argv,envp)
  1225. #endif}
  1226. { Finding offsets of elements within structures.
  1227. * Taken from the X code... they've sweated portability of this stuff
  1228. * so we don't have to. Sigh...
  1229. }
  1230. {#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
  1231. #ifdef __STDC__
  1232. #define XtOffset(p_type,field) _Offsetof(p_type,field)
  1233. #else
  1234. #ifdef CRAY2
  1235. #define XtOffset(p_type,field) \
  1236. (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
  1237. #else} { !CRAY2 }
  1238. {#define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
  1239. #endif }{ !CRAY2 }
  1240. //#endif { __STDC__ }
  1241. //#else { ! (CRAY || __arm) }
  1242. //#define XtOffset(p_type,field) \
  1243. // ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
  1244. //#endif { !CRAY }
  1245. {#ifndef XtOffsetOf
  1246. #ifdef offsetof
  1247. #define XtOffsetOf(s_type,field) offsetof(s_type,field)
  1248. #else
  1249. #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
  1250. #endif
  1251. #endif}
  1252. {
  1253. * NET_SIZE_T exists because of shortsightedness on the POSIX committee. BSD
  1254. * systems used "int *" as the parameter to accept(), getsockname(),
  1255. * getpeername() et al. Consequently many unixes took an int * for that
  1256. * parameter. The POSIX committee decided that "int" was just too generic and
  1257. * had to be replaced with size_t almost everywhere. There's no problem with
  1258. * that when you're passing by value. But when you're passing by reference
  1259. * this creates a gross source incompatibility with existing programs. On
  1260. * 32-bit architectures it creates only a warning. On 64-bit architectures it
  1261. * creates broken code -- because "int *" is a pointer to a 64-bit quantity and
  1262. * "size_t *" is frequently a pointer to a 32-bit quantity.
  1263. *
  1264. * Some Unixes adopted "size_t *" for the sake of POSIX compliance. Others
  1265. * ignored it because it was such a broken interface. Chaos ensued. POSIX
  1266. * finally woke up and decided that it was wrong and created a new type
  1267. * socklen_t. The only useful value for socklen_t is int, and that's how
  1268. * everyone who has a clue implements it. It is almost always the case that
  1269. * NET_SIZE_T should be defined to be an int, unless the system being compiled
  1270. * for was created in the window of POSIX madness.
  1271. }
  1272. type NET_SIZE_T = cint;
  1273. { Linux defines __WCOREDUMP, but doesn't define WCOREDUMP unless __USE_BSD
  1274. * is in use... we'd prefer to just use WCOREDUMP everywhere.
  1275. }
  1276. //#if defined(__WCOREDUMP) && !defined(WCOREDUMP)
  1277. //#define WCOREDUMP __WCOREDUMP
  1278. //#endif
  1279. //#ifdef SUNOS_LIB_PROTOTYPES
  1280. { Prototypes needed to get a clean compile with gcc -Wall.
  1281. * Believe it or not, these do have to be declared, at least on SunOS,
  1282. * because they aren't mentioned in the relevant system headers.
  1283. * Sun Quality Software. Gotta love it. This section is not
  1284. * currently (13Nov97) used.
  1285. }
  1286. {int getopt(int, char **, char *);
  1287. int strcasecmp(const char *, const char *);
  1288. int strncasecmp(const char *, const char *, int);
  1289. int toupper(int);
  1290. int tolower(int);
  1291. int printf(char *,...);
  1292. int fprintf(FILE *, char *,...);
  1293. int fputs(char *, FILE *);
  1294. int fread(char *, int, int, FILE *);
  1295. int fwrite(char *, int, int, FILE *);
  1296. int fgetc(FILE *);
  1297. char *fgets(char *s, int, FILE*);
  1298. int fflush(FILE *);
  1299. int fclose(FILE *);
  1300. int ungetc(int, FILE *);
  1301. int _filbuf(FILE *); }{ !!! }
  1302. //int _flsbuf(unsigned char, FILE *); { !!! }
  1303. {int sscanf(char *, char *,...);
  1304. void setbuf(FILE *, char *);
  1305. void perror(char *);
  1306. time_t time(time_t *);
  1307. int strftime(char *, int, const char *, struct tm *);
  1308. int initgroups(char *, int);}
  1309. //int wait3(int *, int, void *); { Close enough for us... }
  1310. {int lstat(const char *, struct stat *);
  1311. int stat(const char *, struct stat *);
  1312. int flock(int, int);
  1313. #ifndef NO_KILLPG
  1314. int killpg(int, int);
  1315. #endif
  1316. int socket(int, int, int);
  1317. int setsockopt(int, int, int, const char *, int);
  1318. int listen(int, int);
  1319. int bind(int, struct sockaddr *, int);
  1320. int connect(int, struct sockaddr *, int);
  1321. int accept(int, struct sockaddr *, int *);
  1322. int shutdown(int, int);
  1323. int getsockname(int s, struct sockaddr *name, int *namelen);
  1324. int getpeername(int s, struct sockaddr *name, int *namelen);
  1325. int gethostname(char *name, int namelen);
  1326. void syslog(int, char *,...);
  1327. char *mktemp(char *);
  1328. int vfprintf(FILE *, const char *, va_list);
  1329. #endif} { SUNOS_LIB_PROTOTYPES }
  1330. { The assumption is that when the functions are missing,
  1331. * then there's no matching prototype available either.
  1332. * Declare what is needed exactly as the replacement routines implement it.
  1333. }
  1334. {#ifdef NEED_STRDUP
  1335. extern char *strdup (const char *str);
  1336. #endif
  1337. #ifdef NEED_STRCASECMP
  1338. extern int strcasecmp (const char *a, const char *b);
  1339. #endif
  1340. #ifdef NEED_STRNCASECMP
  1341. extern int strncasecmp (const char *a, const char *b, int n);
  1342. #endif
  1343. #ifdef NEED_INITGROUPS
  1344. extern int initgroups(const char *name, gid_t basegid);
  1345. #endif
  1346. #ifdef NEED_WAITPID
  1347. extern int waitpid(pid_t pid, int *statusp, int options);
  1348. #endif
  1349. #ifdef NEED_STRERROR
  1350. extern char *strerror (int err);
  1351. #endif
  1352. #ifdef NEED_DIFFTIME
  1353. extern double difftime(time_t time1, time_t time0);
  1354. #endif}
  1355. {$ifndef ap_wait_t}
  1356. type
  1357. ap_wait_t = cint;
  1358. {$endif}