systems.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /** BEGIN COPYRIGHT BLOCK
  2. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  3. * Copyright (C) 2005 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * License: GPL (version 3 or any later version).
  7. * See LICENSE for details.
  8. * END COPYRIGHT BLOCK **/
  9. #ifdef HAVE_CONFIG_H
  10. # include <config.h>
  11. #endif
  12. #ifndef BASE_SYSTEMS_H
  13. #define BASE_SYSTEMS_H
  14. #ifndef NOINTNSAPI
  15. #define INTNSAPI
  16. #endif /* !NOINTNSAPI */
  17. /*
  18. * systems.h: Lists of defines for systems
  19. *
  20. * This sets what general flavor the system is (UNIX, etc.),
  21. * and defines what extra functions your particular system needs.
  22. */
  23. /* --- Begin common definitions for all supported platforms --- */
  24. #define DAEMON_ANY
  25. #define DAEMON_STATS
  26. /* --- End common definitions for all supported platforms --- */
  27. /* --- Begin platform-specific definitions --- */
  28. #if defined(HPUX)
  29. #define ACCELERATOR_CACHE
  30. #define AUTH_DBM
  31. #undef BSD_RLIMIT
  32. #undef BSD_SIGNALS
  33. #ifdef MCC_PROXY
  34. #define DAEMON_NEEDS_SEMAPHORE
  35. #else
  36. #undef DAEMON_NEEDS_SEMAPHORE
  37. #endif
  38. #define DAEMON_UNIX_MOBRULE
  39. #define DLL_CAPABLE
  40. #define DLL_HPSHL
  41. #define DNS_CACHE
  42. #define FILE_INHERIT_FCNTL
  43. #define FILE_MMAP_FLAGS MAP_PRIVATE
  44. #define HAS_STATFS
  45. #define HAVE_ATEXIT
  46. #define JAVA_STATIC_LINK
  47. #undef NEED_CRYPT_H
  48. #define NET_SOCKETS
  49. #define SA_HANDLER_T(x) (void (*)(int))x
  50. /* warning: mmap doesn't work under 9.04 */
  51. #define SHMEM_MMAP_FLAGS MAP_FILE | MAP_VARIABLE | MAP_SHARED
  52. #elif defined(Linux)
  53. #define ACCELERATOR_CACHE
  54. #define DNS_CACHE
  55. #define FILE_INHERIT_FCNTL
  56. #define DAEMON_UNIX_MOBRULE
  57. #define BSD_RLIMIT
  58. #undef BSD_SIGNALS
  59. #define FILE_UNIX_MMAP
  60. #define FILE_MMAP_FLAGS (MAP_FILE | MAP_SHARED)
  61. #define SHMEM_UNIX_MMAP
  62. #define SHMEM_MMAP_FLAGS MAP_SHARED
  63. #define AUTH_DBM
  64. #define SEM_FLOCK
  65. #define DLL_CAPABLE
  66. #define DLL_DLOPEN
  67. #define DLL_DLOPEN_FLAGS RTLD_NOW
  68. #define HAVE_ATEXIT
  69. #define HAS_STATFS
  70. #define JAVA_STATIC_LINK
  71. #define SA_HANDLER_T(x) (void (*)(int))(x)
  72. #undef NEED_CRYPT_PROTO
  73. #define NET_SOCKETS
  74. #ifndef NO_DOMAINNAME
  75. #define NO_DOMAINNAME
  76. #endif
  77. #elif defined(SOLARIS) || defined(SOLARISx86)
  78. #define ACCELERATOR_CACHE
  79. #define AUTH_DBM
  80. #define BSD_RLIMIT
  81. #undef BSD_SIGNALS
  82. #define DAEMON_NEEDS_SEMAPHORE
  83. #define DAEMON_UNIX_MOBRULE
  84. #define DLL_CAPABLE
  85. #define DLL_DLOPEN
  86. #define DLL_DLOPEN_FLAGS RTLD_NOW
  87. #define DNS_CACHE
  88. #define FILE_INHERIT_FCNTL
  89. #define FILE_MMAP_FLAGS MAP_SHARED
  90. #define HAS_STATVFS
  91. #define HAVE_ATEXIT
  92. #define HAVE_PW_R
  93. #define HAVE_STRTOK_R
  94. #define HAVE_TIME_R 3 /* arg count */
  95. #define NEED_CRYPT_H
  96. #define NEED_FILIO
  97. #if OSVERSION < 506 || OSVERSION == 50501
  98. #define NEED_GHN_PROTO
  99. #endif
  100. #define NET_SOCKETS
  101. #if OSVERSION > 504
  102. #define SA_HANDLER_T(x) x
  103. #endif
  104. #define SHMEM_MMAP_FLAGS MAP_SHARED
  105. #elif defined(SUNOS4)
  106. #define ACCELERATOR_CACHE
  107. #define AUTH_DBM
  108. #define BSD_MAIL
  109. #define BSD_RLIMIT
  110. #define BSD_SIGNALS
  111. #define BSD_TIME
  112. #define DAEMON_UNIX_MOBRULE
  113. #define DLL_CAPABLE
  114. #define DLL_DLOPEN
  115. #define DLL_DLOPEN_FLAGS 1
  116. #define DNS_CACHE
  117. #define FILE_INHERIT_FCNTL
  118. #define FILE_MMAP_FLAGS MAP_SHARED
  119. #define HAS_STATFS
  120. #undef HAVE_ATEXIT
  121. #undef NEED_CRYPT_H
  122. #define NEED_CRYPT_PROTO
  123. #define NEED_FILIO
  124. #define NET_SOCKETS
  125. #define SHMEM_MMAP_FLAGS MAP_SHARED
  126. #else
  127. #error "Missing defines in ns/netsite/include/base/systems.h"
  128. #endif
  129. /* Pick up the configuration symbols in the public interface */
  130. #ifndef PUBLIC_BASE_SYSTEMS_H
  131. #include "public/base/systems.h"
  132. #endif /* PUBLIC_BASE_SYSTEMS_H */
  133. /* --- Begin defaults for values not defined above --- */
  134. #ifndef DAEMON_LISTEN_SIZE
  135. #define DAEMON_LISTEN_SIZE 128
  136. #endif /* !DAEMON_LISTEN_SIZE */
  137. #ifndef SA_HANDLER_T
  138. #define SA_HANDLER_T(x) (void (*)())x
  139. #endif
  140. #ifdef HAS_CONSTVALUED_STRFUNCS
  141. #define CONSTVALSTRCAST (char *)
  142. #else
  143. #define CONSTVALSTRCAST
  144. #endif
  145. #ifndef THROW_HACK
  146. #define THROW_HACK /* as nothing */
  147. #endif
  148. /* --- End defaults for values not defined above --- */
  149. /* --- Begin the great debate --- */
  150. /* NS_MAIL builds sec-key.c which calls systhread_init, which requires */
  151. /* that USE_NSPR is defined when systhr.c is compiled. --lachman */
  152. /* MCC_PROXY does the same thing now --nbreslow -- LIKE HELL --ari */
  153. #define USE_NSPR
  154. /* XXXrobm This is UNIX-only for the moment */
  155. #define LOG_BUFFERING
  156. #ifdef SW_THREADS
  157. #define THREAD_NSPR_USER
  158. #else
  159. #define THREAD_NSPR_KERNEL
  160. #endif /* SW_THREADS */
  161. #define THREAD_ANY
  162. /* --- End the great debate --- */
  163. #ifndef APSTUDIO_READONLY_SYMBOLS
  164. #ifndef NSPR_PRIO_H
  165. #include <prio.h>
  166. #define NSPR_PRIO_H
  167. #endif /* !NSPR_PRIO_H */
  168. /*
  169. * These types have to be defined early, because they are defined
  170. * as (void *) in the public API.
  171. */
  172. #ifndef SYS_FILE_T
  173. typedef PRFileDesc *SYS_FILE;
  174. #define SYS_FILE_T PRFileDesc *
  175. #endif /* !SYS_FILE_T */
  176. #ifndef SYS_NETFD_T
  177. typedef PRFileDesc *SYS_NETFD;
  178. #define SYS_NETFD_T PRFileDesc *
  179. #endif /* !SYS_NETFD_T */
  180. #endif /* !APSTUDIO_READONLY_SYMBOLS */
  181. #endif /* BASE_SYSTEMS_H */