home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / nsfast / root.9 / usr / ns-home / nsapi / include / base / systems.h / systems
Text File  |  1998-08-19  |  12KB  |  551 lines

  1. /*
  2.  * Copyright (c) 1994, 1995.  Netscape Communications Corporation.  All
  3.  * rights reserved.
  4.  * 
  5.  * Use of this software is governed by the terms of the license agreement for
  6.  * the Netscape FastTrack or Netscape Enterprise Server between the
  7.  * parties.
  8.  */
  9.  
  10.  
  11. /* ------------------------------------------------------------------------ */
  12.  
  13.  
  14. /*
  15.  * systems.h: Lists of defines for systems
  16.  * 
  17.  * This sets what general flavor the system is (UNIX, etc.), 
  18.  * and defines what extra functions your particular system needs.
  19.  */
  20.  
  21.  
  22. #ifndef SYSTEMS_H
  23. #define SYSTEMS_H
  24.  
  25. #include <string.h>
  26.  
  27.  
  28. #define DAEMON_ANY
  29.  
  30. #ifdef XP_WIN32
  31. #define DAEMON_LISTEN_SIZE 100
  32. #define NSAPI_PUBLIC __declspec(dllexport)
  33. #else
  34. #ifdef AIX
  35. /* AIX can handle really big shoes */
  36. #define DAEMON_LISTEN_SIZE 4096
  37. #else
  38. #define DAEMON_LISTEN_SIZE 128
  39. #endif
  40. #define NSAPI_PUBLIC
  41. #endif
  42.  
  43. #ifndef MCC_ADMSERV
  44. #define DAEMON_STATS
  45. #endif
  46. #define DAEMON_STATS
  47.  
  48. #if defined(BSDI)
  49.  
  50. #define ACCELERATOR_CACHE
  51. #define MALLOC_POOLS
  52. #define FILE_UNIX
  53. #define DNS_CACHE
  54. #define FILE_INHERIT_FCNTL
  55. #define DAEMON_UNIX_MOBRULE
  56. #ifdef MCC_PROXY
  57. #define DAEMON_NEEDS_SEMAPHORE
  58. #endif
  59. #define BSD_FLOCK
  60. #define BSD_RLIMIT
  61. #define NET_SOCKETS
  62. #define FILE_UNIX_MMAP
  63. #define FILE_MMAP_FLAGS (MAP_FILE | MAP_PRIVATE)
  64. #define SHMEM_UNIX_MMAP
  65. #define SHMEM_MMAP_FLAGS MAP_SHARED
  66. #define BSD_SIGNALS
  67. #define BSD_TIME
  68. #define BSD_MAIL
  69. #define AUTH_DBM
  70. #define SEM_FLOCK
  71. #undef NEED_CRYPT_PROTO
  72. #define HAVE_ATEXIT
  73. #define NO_DOMAINNAME
  74. #define HAS_STATFS
  75. #define JAVA_STATIC_LINK
  76. #define DLL_CAPABLE
  77. #define DLL_DLOPEN
  78. #define DLL_DLOPEN_FLAGS RTLD_NOW
  79.  
  80. #define ZERO(ptr,len) memset(ptr,0,len)
  81.  
  82. #elif defined(LINUX)
  83.  
  84. #define ACCELERATOR_CACHE
  85. #define MALLOC_POOLS
  86. #define DNS_CACHE
  87. #define FILE_UNIX
  88. #define FILE_INHERIT_FCNTL
  89. #define DAEMON_UNIX_MOBRULE
  90. #define BSD_RLIMIT
  91. #undef BSD_SIGNALS
  92. #define FILE_UNIX_MMAP
  93. #define FILE_MMAP_FLAGS (MAP_FILE | MAP_PRIVATE)
  94. #define SHMEM_UNIX_MMAP
  95. #define SHMEM_MMAP_FLAGS MAP_SHARED
  96. #define AUTH_DBM
  97. #define SEM_FLOCK
  98. #define DLL_CAPABLE
  99. #define DLL_DLOPEN
  100. #define DLL_DLOPEN_FLAGS RTLD_NOW
  101. #define HAVE_ATEXIT
  102. #define HAS_STATFS
  103. #define JAVA_STATIC_LINK
  104.  
  105. #define ZERO(ptr,len) memset(ptr,0,len)
  106.  
  107. #elif defined(SOLARIS)
  108.  
  109. #define ACCELERATOR_CACHE
  110. #define MALLOC_POOLS
  111. #define NATIVE_SYSTEM_MALLOC /* Use native system malloc */
  112.  
  113. #define HAVE_TIME_R
  114. #define DNS_CACHE
  115. #undef    FILE_UNIX    /* avoid redefinition message */
  116. #define FILE_UNIX
  117. #define FILE_INHERIT_FCNTL
  118. #define DAEMON_UNIX_MOBRULE
  119.     /* Solaris 2.5 and lower needed the semaphore.
  120.      * With 2.5.1 they don't need it- a routine is added to daemon.c
  121.      * which checks the solaris version number and acts appropriately
  122.      * based on that.
  123.      */
  124. #undef DAEMON_NEEDS_SEMAPHORE
  125. #define NET_SOCKETS
  126. #define FILE_UNIX_MMAP
  127. #define FILE_MMAP_FLAGS MAP_PRIVATE
  128. #define SHMEM_UNIX_MMAP
  129. #define SHMEM_MMAP_FLAGS MAP_SHARED
  130. #undef BSD_SIGNALS
  131. #define BSD_RLIMIT
  132. #define NEED_CRYPT_H
  133. #define AUTH_DBM
  134. /* The Solaris routines return ENOSPC when too many semaphores are SEM_UNDO. */
  135. #define SEM_FLOCK
  136. #define DLL_CAPABLE
  137. #define DLL_DLOPEN
  138. #define DLL_DLOPEN_FLAGS RTLD_NOW
  139. #define HAVE_ATEXIT
  140. #define NEED_FILIO
  141. #define HAS_STATVFS
  142.  
  143. #define ZERO(ptr,len) memset(ptr,0,len)
  144.  
  145. #elif defined(SUNOS4)
  146.  
  147. #define ACCELERATOR_CACHE
  148. #define MALLOC_POOLS
  149. #define DNS_CACHE
  150. #define BSD_SIGNALS
  151. #define BSD_TIME
  152. #define BSD_MAIL
  153. #define BSD_FLOCK
  154. #define BSD_RLIMIT
  155. #define FILE_UNIX
  156. #define FILE_INHERIT_FCNTL
  157. #define DAEMON_UNIX_MOBRULE
  158. #define NET_SOCKETS
  159. #define FILE_UNIX_MMAP
  160. #define FILE_MMAP_FLAGS MAP_PRIVATE
  161. #define SHMEM_UNIX_MMAP
  162. #define SHMEM_MMAP_FLAGS MAP_SHARED
  163. #undef NEED_CRYPT_H
  164. #define NEED_CRYPT_PROTO
  165. #define AUTH_DBM
  166. #define SEM_FLOCK
  167. #define ZERO(ptr,len) memset(ptr,0,len)
  168. #define DLL_CAPABLE
  169. #define DLL_DLOPEN
  170. #define DLL_DLOPEN_FLAGS 1
  171. #undef HAVE_ATEXIT
  172. #define NEED_FILIO
  173. #define HAS_STATFS
  174. #define JAVA_STATIC_LINK
  175.  
  176. #elif defined(UNIXWARE) || defined(UnixWare)
  177.  
  178. #define ACCELERATOR_CACHE
  179. #define MALLOC_POOLS
  180. #define DNS_CACHE
  181. #define FILE_UNIX
  182. #define FILE_INHERIT_FCNTL
  183. #define DAEMON_UNIX_MOBRULE
  184. #ifdef MCC_PROXY
  185. #define DAEMON_NEEDS_SEMAPHORE
  186. #endif
  187. #define NET_SOCKETS
  188. #define FILE_UNIX_MMAP
  189. #define FILE_MMAP_FLAGS MAP_PRIVATE
  190. #define SHMEM_UNIX_MMAP
  191. #define SHMEM_MMAP_FLAGS MAP_SHARED
  192. #undef BSD_RLIMIT
  193. #define NEED_CRYPT_H
  194. #define AUTH_DBM
  195. /* The Solaris routines return ENOSPC when too many semaphores are SEM_UNDO. */
  196. #define SEM_FLOCK
  197. #define DLL_CAPABLE
  198. #define DLL_DLOPEN
  199. #define DLL_DLOPEN_FLAGS RTLD_NOW
  200. #define NEED_STRCASECMP
  201. #define HAVE_ATEXIT
  202. #define NEED_FILIO
  203. #define HAS_STATVFS
  204. #define CASECMPARG_T const
  205. #define JAVA_STATIC_LINK
  206. #define HAVE_NETCONFIG
  207.  
  208. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  209.  
  210. #define ZERO(ptr,len) memset(ptr,0,len)
  211.  
  212. /* Anything for Gemini SVR5 (UnixWare) goes here */
  213. #ifdef SVR5
  214. /* SENDV: Gemini Streams enhancement, for bl14 and later      */
  215. /* #define SENDV                      */
  216. /* prevent server hang under extreme loads, through Gemini bl13       */
  217. /* #define DAEMON_NEEDS_SEMAPHORE     */
  218. #endif
  219.  
  220. #elif defined(NECSVR4) || defined(NCR)
  221.  
  222. #define ACCELERATOR_CACHE
  223. #define MALLOC_POOLS
  224. #define DNS_CACHE
  225. #undef FILE_UNIX
  226. #define FILE_UNIX
  227. #define FILE_INHERIT_FCNTL
  228. #define DAEMON_UNIX_MOBRULE
  229. #ifdef MCC_PROXY
  230. #define DAEMON_NEEDS_SEMAPHORE
  231. #endif
  232. #define NET_SOCKETS
  233. #define FILE_UNIX_MMAP
  234. #define FILE_MMAP_FLAGS MAP_PRIVATE
  235. #define SHMEM_UNIX_MMAP
  236. #define SHMEM_MMAP_FLAGS MAP_SHARED
  237. #undef BSD_RLIMIT
  238. #define NEED_CRYPT_H
  239. #define AUTH_DBM
  240. #define SEM_FLOCK
  241. #define DLL_CAPABLE
  242. #define DLL_DLOPEN
  243. #define DLL_DLOPEN_FLAGS RTLD_NOW
  244. #define NEED_STRCASECMP
  245. #define HAVE_ATEXIT
  246. #define NEED_FILIO
  247. #define HAS_STATVFS
  248. #define JAVA_STATIC_LINK
  249. #define HAVE_NETCONFIG
  250.  
  251. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  252.  
  253. #define ZERO(ptr,len) memset(ptr,0,len)
  254.  
  255. #elif defined (SONY)
  256.  
  257. #define ACCELERATOR_CACHE
  258. #define MALLOC_POOLS
  259. #define DNS_CACHE
  260. #define FILE_UNIX
  261. #define FILE_INHERIT_FCNTL
  262. #define DAEMON_UNIX_MOBRULE
  263. #ifdef MCC_PROXY
  264. #define DAEMON_NEEDS_SEMAPHORE
  265. #endif
  266. #define NET_SOCKETS
  267. #define FILE_UNIX_MMAP
  268. #define FILE_MMAP_FLAGS MAP_PRIVATE
  269. #define SHMEM_UNIX_MMAP
  270. #define SHMEM_MMAP_FLAGS MAP_SHARED
  271. #undef BSD_RLIMIT
  272. #define NEED_CRYPT_H
  273. #define AUTH_DBM
  274. #define SEM_FLOCK
  275. #define DLL_CAPABLE
  276. #define NEED_STRCASECMP
  277. #define HAVE_ATEXIT
  278. #define NEED_FILIO
  279. #define JAVA_STATIC_LINK
  280.  
  281. #define ZERO(ptr,len) memset(ptr,0,len)
  282.  
  283. #elif defined(SCO)
  284.  
  285. #define ACCELERATOR_CACHE
  286. #define MALLOC_POOLS
  287. #define DNS_CACHE
  288. #define FILE_UNIX
  289. #define FILE_INHERIT_FCNTL
  290. #ifdef MCC_PROXY
  291. #define DAEMON_NEEDS_SEMAPHORE
  292. #endif
  293. #define DAEMON_UNIX_MOBRULE
  294. #define NET_SOCKETS
  295. #define FILE_UNIX_MMAP
  296. #define FILE_MMAP_FLAGS MAP_PRIVATE
  297. #define SHMEM_UNIX_MMAP
  298. #define SHMEM_MMAP_FLAGS MAP_SHARED
  299. #undef BSD_SIGNALS
  300. #undef BSD_RLIMIT
  301. #undef NEED_CRYPT_H
  302. #define AUTH_DBM
  303. #define SEM_FLOCK
  304. #define ZERO(ptr,len) memset(ptr,0,len)
  305. #define DLL_CAPABLE
  306. #define DLL_DLOPEN
  307. #define DLL_DLOPEN_FLAGS RTLD_NOW
  308. #define HAVE_ATEXIT
  309. #define HAS_STATVFS
  310. #define JAVA_STATIC_LINK
  311.  
  312. #elif defined(OSF1)
  313.  
  314. #ifdef HW_THREADS
  315. #define HAVE_TIME_R
  316. #endif
  317. #define ACCELERATOR_CACHE
  318. #define MALLOC_POOLS
  319. #define DNS_CACHE
  320. #undef BSD_SIGNALS
  321. #define BSD_TIME
  322. #undef BSD_FLOCK
  323. #define BSD_RLIMIT
  324. #define FILE_UNIX
  325. #define FILE_INHERIT_FCNTL
  326. #define DAEMON_UNIX_MOBRULE
  327. #ifdef MCC_PROXY
  328. #define DAEMON_NEEDS_SEMAPHORE
  329. #endif
  330. #define NET_SOCKETS
  331. #define FILE_UNIX_MMAP
  332. #define FILE_MMAP_FLAGS MAP_PRIVATE
  333. #define SHMEM_UNIX_MMAP
  334. #define SHMEM_MMAP_FLAGS MAP_SHARED
  335. #define AUTH_DBM
  336. #define SEM_FLOCK
  337. #define ZERO(ptr,len) memset(ptr,0,len)
  338. #define DLL_CAPABLE
  339. #define DLL_DLOPEN
  340. #define DLL_DLOPEN_FLAGS RTLD_NOW
  341. #define HAVE_ATEXIT
  342.  
  343. #elif defined(AIX)
  344. #ifdef HW_THREADS
  345. #define THREAD_ANY
  346. #define HAVE_TIME_R
  347. #undef  NEED_TIME_R
  348. #endif
  349.  
  350. #define ACCELERATOR_CACHE
  351. #define MALLOC_POOLS
  352. #define DNS_CACHE
  353. #define FILE_UNIX
  354. #define FILE_INHERIT_FCNTL
  355. #define DAEMON_UNIX_MOBRULE
  356. #define DAEMON_NEEDS_SEMAPHORE 
  357. #define NET_SOCKETS
  358. #define FILE_UNIX_MMAP
  359. #define FILE_MMAP_FLAGS MAP_PRIVATE
  360. #define SHMEM_UNIX_MMAP
  361. #define SHMEM_MMAP_FLAGS MAP_SHARED
  362. #undef BSD_SIGNALS
  363. #define BSD_RLIMIT
  364. #undef NEED_CRYPT_H
  365. #define AUTH_DBM
  366. #define SEM_FLOCK
  367. #define ZERO(ptr,len) memset(ptr,0,len)
  368. #define DLL_CAPABLE
  369. #define DLL_DLOPEN
  370. #define DLL_DLOPEN_FLAGS 1
  371. #define HAVE_ATEXIT
  372. #define HAS_STATFS
  373. #define JAVA_STATIC_LINK
  374.  
  375. #elif defined(HPUX)
  376.  
  377. #define ACCELERATOR_CACHE
  378. #define MALLOC_POOLS
  379. #define DNS_CACHE
  380. #define FILE_UNIX
  381. #define FILE_INHERIT_FCNTL
  382. #define DAEMON_UNIX_MOBRULE
  383. #ifdef MCC_PROXY
  384. #define DAEMON_NEEDS_SEMAPHORE
  385. #endif
  386. #define NET_SOCKETS
  387. /* warning: mmap doesn't work under 9.04 */
  388. #define FILE_UNIX_MMAP
  389. #define FILE_MMAP_FLAGS MAP_PRIVATE
  390. #define SHMEM_UNIX_MMAP
  391. #define SHMEM_MMAP_FLAGS MAP_FILE | MAP_VARIABLE | MAP_SHARED
  392. #undef BSD_SIGNALS
  393. #undef BSD_RLIMIT
  394. #undef NEED_CRYPT_H
  395. #define AUTH_DBM
  396. #define SEM_FLOCK
  397. #define ZERO(ptr,len) memset(ptr,0,len)
  398. #define DLL_CAPABLE
  399. #define DLL_HPSHL
  400. #define HAVE_ATEXIT
  401. #define HAS_STATFS
  402. #define JAVA_STATIC_LINK
  403.  
  404. #elif defined (IRIX)
  405.  
  406. #define HAVE_TIME_R
  407. #define ACCELERATOR_CACHE
  408. #define MALLOC_POOLS
  409. #define DNS_CACHE
  410. #define FILE_UNIX
  411. #define FILE_INHERIT_FCNTL
  412. #define DAEMON_UNIX_MOBRULE
  413. #define DLL_CAPABLE
  414. #define DLL_DLOPEN
  415. #define DLL_DLOPEN_FLAGS RTLD_NOW
  416. #define NET_SOCKETS
  417. #define FILE_UNIX_MMAP
  418. #define FILE_MMAP_FLAGS MAP_PRIVATE
  419. #define SHMEM_UNIX_MMAP
  420. #define SHMEM_MMAP_FLAGS MAP_SHARED
  421. #undef BSD_SIGNALS
  422. #define BSD_RLIMIT
  423. #define NEED_CRYPT_H
  424. #define AUTH_DBM
  425. #define SEM_FLOCK
  426. #define ZERO(ptr,len) memset(ptr,0,len)
  427. #define HAVE_ATEXIT
  428. #define HAS_STATVFS
  429.  
  430. #elif defined(SNI)
  431.  
  432. #define FILE_UNIX
  433. #define FILE_INHERIT_FCNTL
  434. #define DAEMON_UNIX_MOBRULE
  435. #ifdef MCC_PROXY
  436. #define DAEMON_NEEDS_SEMAPHORE
  437. #endif
  438. #define NET_SOCKETS
  439. #define FILE_UNIX_MMAP
  440. #define FILE_MMAP_FLAGS MAP_PRIVATE
  441. #define SHMEM_UNIX_MMAP
  442. #define SHMEM_MMAP_FLAGS MAP_SHARED
  443. #undef BSD_RLIMIT
  444. #define NEED_CRYPT_H
  445. #define AUTH_DBM
  446. #define SEM_FLOCK
  447. #define DLL_CAPABLE
  448. #define DLL_DLOPEN
  449. #define DLL_DLOPEN_FLAGS RTLD_NOW
  450. #define NEED_STRCASECMP
  451. #define HAVE_ATEXIT
  452. /* ??? */
  453. #define ACCELERATOR_CACHE
  454. #define MALLOC_POOLS
  455. #define DNS_CACHE
  456.  
  457. #define USE_PIPE
  458. #define NEED_FILIO
  459. #define HAS_STATVFS
  460. #define JAVA_STATIC_LINK
  461. #define HAVE_NETCONFIG
  462.  
  463. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  464.  
  465. #define ZERO(ptr,len) memset(ptr,0,len)
  466.  
  467. #elif defined (XP_WIN32)      /* Windows NT */
  468.  
  469. #include <wtypes.h>
  470. #include <winbase.h>
  471.  
  472. typedef void* PASSWD;
  473.  
  474. #define ACCELERATOR_CACHE
  475. #define MALLOC_POOLS
  476. #define DNS_CACHE
  477. #define LOG_BUFFERING
  478. #define FILE_WIN32
  479. #define FILE_WIN32_MMAP
  480. #define SHMEM_WIN32_MMAP
  481. #define NET_SOCKETS
  482. #define NET_WINSOCK
  483. #define DAEMON_ANY
  484. #define DAEMON_WIN32
  485. #define AUTH_DBM
  486. #define ZERO(ptr, len) ZeroMemory(ptr, len)
  487. #define caddr_t PCHAR
  488. #define SEM_WIN32
  489. #define DLL_CAPABLE
  490. #define DLL_WIN32
  491. #define THREAD_ANY
  492. #define USE_NSPR
  493. #define THREAD_NSPR_KERNEL
  494. #define NEED_CRYPT_PROTO
  495. #define NO_DOMAINNAME
  496. #define NEEDS_WRITEV
  497.  
  498. /* The stat call under NT doesn't define these macros */
  499. #ifndef S_ISDIR
  500. #define S_ISDIR(mode)   ((mode&S_IFMT) == S_IFDIR)
  501. #endif
  502. #ifndef S_ISREG
  503. #define S_ISREG(mode)   ((mode&S_IFMT) == S_IFREG)                             
  504. #endif
  505. #ifndef S_ISLNK
  506. #define S_ISLNK(x) (0)
  507. #endif
  508.  
  509. #define NEED_STRCASECMP
  510. #endif    /* Windows NT */
  511.  
  512.  
  513. #if defined(FILE_UNIX_MMAP) || defined(FILE_WIN32_MMAP)
  514. #define FILE_MMAP
  515. #endif
  516.  
  517. #ifdef NEED_STRCASECMP
  518. #ifndef CASECMPARG_T
  519. #define CASECMPARG_T
  520. #endif
  521. #define strcasecmp util_strcasecmp
  522. #define strncasecmp util_strncasecmp
  523. NSAPI_PUBLIC int util_strcasecmp(CASECMPARG_T char *s1, CASECMPARG_T char *s2);
  524. NSAPI_PUBLIC int util_strncasecmp(CASECMPARG_T char *s1, CASECMPARG_T char *s2, int n);
  525. #endif
  526.  
  527. /* NS_MAIL builds sec-key.c which calls systhread_init, which requires */
  528. /* that USE_NSPR is defined when systhr.c is compiled.  --lachman */
  529. /* MCC_PROXY does the same thing now --nbreslow -- LIKE HELL --ari */
  530. #if (defined(MCC_BATMAN) || defined(MCC_HTTPD) || defined(MCC_ADMSERV) || defined(NS_MAIL)) && defined(XP_UNIX)
  531. #define USE_NSPR
  532. /* XXXrobm This is UNIX-only for the moment */
  533. #define LOG_BUFFERING
  534. #ifdef SW_THREADS
  535. #define THREAD_NSPR_USER
  536. #else
  537. #define THREAD_NSPR_KERNEL
  538. #ifdef IRIX
  539. #undef SEM_FLOCK
  540. #define SEM_IRIX
  541. #endif 
  542. #endif
  543. #define THREAD_ANY
  544. #endif
  545.  
  546. #if defined(SNI)
  547. #define socketpair(a,b,c,d) pipe(d)
  548. #endif
  549.  
  550. #endif
  551.