nginxtra 1.0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (363) hide show
  1. data/VERSION +1 -0
  2. data/bin/nginxtra +5 -0
  3. data/lib/nginxtra.rb +12 -0
  4. data/lib/nginxtra/action.rb +36 -0
  5. data/lib/nginxtra/actions/compile.rb +60 -0
  6. data/lib/nginxtra/actions/install.rb +99 -0
  7. data/lib/nginxtra/actions/reload.rb +14 -0
  8. data/lib/nginxtra/actions/restart.rb +15 -0
  9. data/lib/nginxtra/actions/start.rb +53 -0
  10. data/lib/nginxtra/actions/status.rb +31 -0
  11. data/lib/nginxtra/actions/stop.rb +14 -0
  12. data/lib/nginxtra/cli.rb +77 -0
  13. data/lib/nginxtra/config.rb +339 -0
  14. data/lib/nginxtra/error.rb +13 -0
  15. data/lib/nginxtra/status.rb +57 -0
  16. data/src/nginx/CHANGES +5630 -0
  17. data/src/nginx/CHANGES.ru +5716 -0
  18. data/src/nginx/LICENSE +25 -0
  19. data/src/nginx/README +3 -0
  20. data/src/nginx/auto/cc/acc +15 -0
  21. data/src/nginx/auto/cc/bcc +72 -0
  22. data/src/nginx/auto/cc/ccc +46 -0
  23. data/src/nginx/auto/cc/conf +189 -0
  24. data/src/nginx/auto/cc/gcc +183 -0
  25. data/src/nginx/auto/cc/icc +121 -0
  26. data/src/nginx/auto/cc/msvc +138 -0
  27. data/src/nginx/auto/cc/name +101 -0
  28. data/src/nginx/auto/cc/owc +104 -0
  29. data/src/nginx/auto/cc/sunc +158 -0
  30. data/src/nginx/auto/define +12 -0
  31. data/src/nginx/auto/endianess +45 -0
  32. data/src/nginx/auto/feature +123 -0
  33. data/src/nginx/auto/have +12 -0
  34. data/src/nginx/auto/have_headers +12 -0
  35. data/src/nginx/auto/headers +13 -0
  36. data/src/nginx/auto/include +61 -0
  37. data/src/nginx/auto/init +51 -0
  38. data/src/nginx/auto/install +184 -0
  39. data/src/nginx/auto/lib/conf +83 -0
  40. data/src/nginx/auto/lib/geoip/conf +79 -0
  41. data/src/nginx/auto/lib/google-perftools/conf +45 -0
  42. data/src/nginx/auto/lib/libatomic/conf +43 -0
  43. data/src/nginx/auto/lib/libatomic/make +14 -0
  44. data/src/nginx/auto/lib/libgd/conf +83 -0
  45. data/src/nginx/auto/lib/libxslt/conf +156 -0
  46. data/src/nginx/auto/lib/make +32 -0
  47. data/src/nginx/auto/lib/md5/conf +103 -0
  48. data/src/nginx/auto/lib/md5/make +96 -0
  49. data/src/nginx/auto/lib/md5/makefile.bcc +22 -0
  50. data/src/nginx/auto/lib/md5/makefile.msvc +22 -0
  51. data/src/nginx/auto/lib/md5/makefile.owc +11 -0
  52. data/src/nginx/auto/lib/openssl/conf +74 -0
  53. data/src/nginx/auto/lib/openssl/make +67 -0
  54. data/src/nginx/auto/lib/openssl/makefile.bcc +18 -0
  55. data/src/nginx/auto/lib/openssl/makefile.msvc +14 -0
  56. data/src/nginx/auto/lib/pcre/conf +180 -0
  57. data/src/nginx/auto/lib/pcre/make +64 -0
  58. data/src/nginx/auto/lib/pcre/makefile.bcc +26 -0
  59. data/src/nginx/auto/lib/pcre/makefile.msvc +22 -0
  60. data/src/nginx/auto/lib/pcre/makefile.owc +24 -0
  61. data/src/nginx/auto/lib/perl/conf +60 -0
  62. data/src/nginx/auto/lib/perl/make +36 -0
  63. data/src/nginx/auto/lib/sha1/conf +79 -0
  64. data/src/nginx/auto/lib/sha1/make +96 -0
  65. data/src/nginx/auto/lib/sha1/makefile.bcc +22 -0
  66. data/src/nginx/auto/lib/sha1/makefile.msvc +22 -0
  67. data/src/nginx/auto/lib/sha1/makefile.owc +11 -0
  68. data/src/nginx/auto/lib/test +40 -0
  69. data/src/nginx/auto/lib/zlib/conf +76 -0
  70. data/src/nginx/auto/lib/zlib/make +114 -0
  71. data/src/nginx/auto/lib/zlib/makefile.bcc +15 -0
  72. data/src/nginx/auto/lib/zlib/makefile.msvc +14 -0
  73. data/src/nginx/auto/lib/zlib/makefile.owc +14 -0
  74. data/src/nginx/auto/lib/zlib/patch.zlib.h +10 -0
  75. data/src/nginx/auto/make +417 -0
  76. data/src/nginx/auto/modules +479 -0
  77. data/src/nginx/auto/nohave +12 -0
  78. data/src/nginx/auto/options +490 -0
  79. data/src/nginx/auto/os/conf +105 -0
  80. data/src/nginx/auto/os/darwin +116 -0
  81. data/src/nginx/auto/os/freebsd +136 -0
  82. data/src/nginx/auto/os/linux +152 -0
  83. data/src/nginx/auto/os/solaris +60 -0
  84. data/src/nginx/auto/os/win32 +29 -0
  85. data/src/nginx/auto/sources +518 -0
  86. data/src/nginx/auto/stubs +8 -0
  87. data/src/nginx/auto/summary +114 -0
  88. data/src/nginx/auto/types/sizeof +83 -0
  89. data/src/nginx/auto/types/typedef +77 -0
  90. data/src/nginx/auto/types/uintptr_t +42 -0
  91. data/src/nginx/auto/types/value +12 -0
  92. data/src/nginx/auto/unix +719 -0
  93. data/src/nginx/conf/fastcgi.conf +24 -0
  94. data/src/nginx/conf/fastcgi_params +23 -0
  95. data/src/nginx/conf/koi-utf +109 -0
  96. data/src/nginx/conf/koi-win +103 -0
  97. data/src/nginx/conf/mime.types +80 -0
  98. data/src/nginx/conf/nginx.conf +118 -0
  99. data/src/nginx/conf/scgi_params +15 -0
  100. data/src/nginx/conf/uwsgi_params +15 -0
  101. data/src/nginx/conf/win-utf +126 -0
  102. data/src/nginx/configure +108 -0
  103. data/src/nginx/contrib/README +15 -0
  104. data/src/nginx/contrib/geo2nginx.pl +58 -0
  105. data/src/nginx/contrib/unicode2nginx/koi-utf +131 -0
  106. data/src/nginx/contrib/unicode2nginx/unicode-to-nginx.pl +45 -0
  107. data/src/nginx/contrib/unicode2nginx/win-utf +130 -0
  108. data/src/nginx/html/50x.html +18 -0
  109. data/src/nginx/html/index.html +8 -0
  110. data/src/nginx/man/nginx.8 +202 -0
  111. data/src/nginx/src/core/nginx.c +1333 -0
  112. data/src/nginx/src/core/nginx.h +20 -0
  113. data/src/nginx/src/core/ngx_array.c +147 -0
  114. data/src/nginx/src/core/ngx_array.h +53 -0
  115. data/src/nginx/src/core/ngx_buf.c +218 -0
  116. data/src/nginx/src/core/ngx_buf.h +162 -0
  117. data/src/nginx/src/core/ngx_conf_file.c +1506 -0
  118. data/src/nginx/src/core/ngx_conf_file.h +348 -0
  119. data/src/nginx/src/core/ngx_config.h +134 -0
  120. data/src/nginx/src/core/ngx_connection.c +1074 -0
  121. data/src/nginx/src/core/ngx_connection.h +195 -0
  122. data/src/nginx/src/core/ngx_core.h +95 -0
  123. data/src/nginx/src/core/ngx_cpuinfo.c +139 -0
  124. data/src/nginx/src/core/ngx_crc.h +39 -0
  125. data/src/nginx/src/core/ngx_crc32.c +129 -0
  126. data/src/nginx/src/core/ngx_crc32.h +79 -0
  127. data/src/nginx/src/core/ngx_crypt.c +238 -0
  128. data/src/nginx/src/core/ngx_crypt.h +20 -0
  129. data/src/nginx/src/core/ngx_cycle.c +1379 -0
  130. data/src/nginx/src/core/ngx_cycle.h +142 -0
  131. data/src/nginx/src/core/ngx_file.c +993 -0
  132. data/src/nginx/src/core/ngx_file.h +151 -0
  133. data/src/nginx/src/core/ngx_hash.c +976 -0
  134. data/src/nginx/src/core/ngx_hash.h +122 -0
  135. data/src/nginx/src/core/ngx_inet.c +1008 -0
  136. data/src/nginx/src/core/ngx_inet.h +120 -0
  137. data/src/nginx/src/core/ngx_list.c +71 -0
  138. data/src/nginx/src/core/ngx_list.h +83 -0
  139. data/src/nginx/src/core/ngx_log.c +459 -0
  140. data/src/nginx/src/core/ngx_log.h +250 -0
  141. data/src/nginx/src/core/ngx_md5.c +289 -0
  142. data/src/nginx/src/core/ngx_md5.h +60 -0
  143. data/src/nginx/src/core/ngx_murmurhash.c +50 -0
  144. data/src/nginx/src/core/ngx_murmurhash.h +19 -0
  145. data/src/nginx/src/core/ngx_open_file_cache.c +882 -0
  146. data/src/nginx/src/core/ngx_open_file_cache.h +119 -0
  147. data/src/nginx/src/core/ngx_output_chain.c +673 -0
  148. data/src/nginx/src/core/ngx_palloc.c +433 -0
  149. data/src/nginx/src/core/ngx_palloc.h +95 -0
  150. data/src/nginx/src/core/ngx_parse.c +249 -0
  151. data/src/nginx/src/core/ngx_parse.h +24 -0
  152. data/src/nginx/src/core/ngx_queue.c +80 -0
  153. data/src/nginx/src/core/ngx_queue.h +112 -0
  154. data/src/nginx/src/core/ngx_radix_tree.c +291 -0
  155. data/src/nginx/src/core/ngx_radix_tree.h +46 -0
  156. data/src/nginx/src/core/ngx_rbtree.c +383 -0
  157. data/src/nginx/src/core/ngx_rbtree.h +84 -0
  158. data/src/nginx/src/core/ngx_regex.c +206 -0
  159. data/src/nginx/src/core/ngx_regex.h +56 -0
  160. data/src/nginx/src/core/ngx_resolver.c +2201 -0
  161. data/src/nginx/src/core/ngx_resolver.h +149 -0
  162. data/src/nginx/src/core/ngx_sha1.h +31 -0
  163. data/src/nginx/src/core/ngx_shmtx.c +284 -0
  164. data/src/nginx/src/core/ngx_shmtx.h +38 -0
  165. data/src/nginx/src/core/ngx_slab.c +701 -0
  166. data/src/nginx/src/core/ngx_slab.h +54 -0
  167. data/src/nginx/src/core/ngx_spinlock.c +53 -0
  168. data/src/nginx/src/core/ngx_string.c +1837 -0
  169. data/src/nginx/src/core/ngx_string.h +231 -0
  170. data/src/nginx/src/core/ngx_times.c +407 -0
  171. data/src/nginx/src/core/ngx_times.h +51 -0
  172. data/src/nginx/src/event/modules/ngx_aio_module.c +171 -0
  173. data/src/nginx/src/event/modules/ngx_devpoll_module.c +569 -0
  174. data/src/nginx/src/event/modules/ngx_epoll_module.c +833 -0
  175. data/src/nginx/src/event/modules/ngx_eventport_module.c +602 -0
  176. data/src/nginx/src/event/modules/ngx_kqueue_module.c +785 -0
  177. data/src/nginx/src/event/modules/ngx_poll_module.c +443 -0
  178. data/src/nginx/src/event/modules/ngx_rtsig_module.c +735 -0
  179. data/src/nginx/src/event/modules/ngx_select_module.c +435 -0
  180. data/src/nginx/src/event/modules/ngx_win32_select_module.c +400 -0
  181. data/src/nginx/src/event/ngx_event.c +1275 -0
  182. data/src/nginx/src/event/ngx_event.h +573 -0
  183. data/src/nginx/src/event/ngx_event_accept.c +428 -0
  184. data/src/nginx/src/event/ngx_event_busy_lock.c +286 -0
  185. data/src/nginx/src/event/ngx_event_busy_lock.h +65 -0
  186. data/src/nginx/src/event/ngx_event_connect.c +258 -0
  187. data/src/nginx/src/event/ngx_event_connect.h +76 -0
  188. data/src/nginx/src/event/ngx_event_mutex.c +70 -0
  189. data/src/nginx/src/event/ngx_event_openssl.c +2382 -0
  190. data/src/nginx/src/event/ngx_event_openssl.h +162 -0
  191. data/src/nginx/src/event/ngx_event_pipe.c +996 -0
  192. data/src/nginx/src/event/ngx_event_pipe.h +95 -0
  193. data/src/nginx/src/event/ngx_event_posted.c +173 -0
  194. data/src/nginx/src/event/ngx_event_posted.h +75 -0
  195. data/src/nginx/src/event/ngx_event_timer.c +159 -0
  196. data/src/nginx/src/event/ngx_event_timer.h +102 -0
  197. data/src/nginx/src/http/modules/ngx_http_access_module.c +384 -0
  198. data/src/nginx/src/http/modules/ngx_http_addition_filter_module.c +250 -0
  199. data/src/nginx/src/http/modules/ngx_http_auth_basic_module.c +478 -0
  200. data/src/nginx/src/http/modules/ngx_http_autoindex_module.c +701 -0
  201. data/src/nginx/src/http/modules/ngx_http_browser_module.c +713 -0
  202. data/src/nginx/src/http/modules/ngx_http_charset_filter_module.c +1681 -0
  203. data/src/nginx/src/http/modules/ngx_http_chunked_filter_module.c +242 -0
  204. data/src/nginx/src/http/modules/ngx_http_dav_module.c +1141 -0
  205. data/src/nginx/src/http/modules/ngx_http_degradation_module.c +243 -0
  206. data/src/nginx/src/http/modules/ngx_http_empty_gif_module.c +140 -0
  207. data/src/nginx/src/http/modules/ngx_http_fastcgi_module.c +2916 -0
  208. data/src/nginx/src/http/modules/ngx_http_flv_module.c +254 -0
  209. data/src/nginx/src/http/modules/ngx_http_geo_module.c +1441 -0
  210. data/src/nginx/src/http/modules/ngx_http_geoip_module.c +671 -0
  211. data/src/nginx/src/http/modules/ngx_http_gzip_filter_module.c +1206 -0
  212. data/src/nginx/src/http/modules/ngx_http_gzip_static_module.c +299 -0
  213. data/src/nginx/src/http/modules/ngx_http_headers_filter_module.c +616 -0
  214. data/src/nginx/src/http/modules/ngx_http_image_filter_module.c +1489 -0
  215. data/src/nginx/src/http/modules/ngx_http_index_module.c +516 -0
  216. data/src/nginx/src/http/modules/ngx_http_limit_req_module.c +809 -0
  217. data/src/nginx/src/http/modules/ngx_http_limit_zone_module.c +553 -0
  218. data/src/nginx/src/http/modules/ngx_http_log_module.c +1357 -0
  219. data/src/nginx/src/http/modules/ngx_http_map_module.c +575 -0
  220. data/src/nginx/src/http/modules/ngx_http_memcached_module.c +624 -0
  221. data/src/nginx/src/http/modules/ngx_http_mp4_module.c +3000 -0
  222. data/src/nginx/src/http/modules/ngx_http_not_modified_filter_module.c +143 -0
  223. data/src/nginx/src/http/modules/ngx_http_proxy_module.c +2831 -0
  224. data/src/nginx/src/http/modules/ngx_http_random_index_module.c +317 -0
  225. data/src/nginx/src/http/modules/ngx_http_range_filter_module.c +855 -0
  226. data/src/nginx/src/http/modules/ngx_http_realip_module.c +476 -0
  227. data/src/nginx/src/http/modules/ngx_http_referer_module.c +613 -0
  228. data/src/nginx/src/http/modules/ngx_http_rewrite_module.c +1019 -0
  229. data/src/nginx/src/http/modules/ngx_http_scgi_module.c +1714 -0
  230. data/src/nginx/src/http/modules/ngx_http_secure_link_module.c +355 -0
  231. data/src/nginx/src/http/modules/ngx_http_split_clients_module.c +242 -0
  232. data/src/nginx/src/http/modules/ngx_http_ssi_filter_module.c +2913 -0
  233. data/src/nginx/src/http/modules/ngx_http_ssi_filter_module.h +114 -0
  234. data/src/nginx/src/http/modules/ngx_http_ssl_module.c +652 -0
  235. data/src/nginx/src/http/modules/ngx_http_ssl_module.h +52 -0
  236. data/src/nginx/src/http/modules/ngx_http_static_module.c +278 -0
  237. data/src/nginx/src/http/modules/ngx_http_stub_status_module.c +144 -0
  238. data/src/nginx/src/http/modules/ngx_http_sub_filter_module.c +716 -0
  239. data/src/nginx/src/http/modules/ngx_http_upstream_ip_hash_module.c +237 -0
  240. data/src/nginx/src/http/modules/ngx_http_userid_filter_module.c +846 -0
  241. data/src/nginx/src/http/modules/ngx_http_uwsgi_module.c +1774 -0
  242. data/src/nginx/src/http/modules/ngx_http_xslt_filter_module.c +984 -0
  243. data/src/nginx/src/http/modules/perl/Makefile.PL +42 -0
  244. data/src/nginx/src/http/modules/perl/nginx.pm +137 -0
  245. data/src/nginx/src/http/modules/perl/nginx.xs +986 -0
  246. data/src/nginx/src/http/modules/perl/ngx_http_perl_module.c +1076 -0
  247. data/src/nginx/src/http/modules/perl/ngx_http_perl_module.h +67 -0
  248. data/src/nginx/src/http/modules/perl/typemap +3 -0
  249. data/src/nginx/src/http/ngx_http.c +2073 -0
  250. data/src/nginx/src/http/ngx_http.h +160 -0
  251. data/src/nginx/src/http/ngx_http_busy_lock.c +307 -0
  252. data/src/nginx/src/http/ngx_http_busy_lock.h +54 -0
  253. data/src/nginx/src/http/ngx_http_cache.h +148 -0
  254. data/src/nginx/src/http/ngx_http_config.h +75 -0
  255. data/src/nginx/src/http/ngx_http_copy_filter_module.c +300 -0
  256. data/src/nginx/src/http/ngx_http_core_module.c +4736 -0
  257. data/src/nginx/src/http/ngx_http_core_module.h +541 -0
  258. data/src/nginx/src/http/ngx_http_file_cache.c +1715 -0
  259. data/src/nginx/src/http/ngx_http_header_filter_module.c +623 -0
  260. data/src/nginx/src/http/ngx_http_parse.c +1734 -0
  261. data/src/nginx/src/http/ngx_http_parse_time.c +276 -0
  262. data/src/nginx/src/http/ngx_http_postpone_filter_module.c +178 -0
  263. data/src/nginx/src/http/ngx_http_request.c +3181 -0
  264. data/src/nginx/src/http/ngx_http_request.h +573 -0
  265. data/src/nginx/src/http/ngx_http_request_body.c +644 -0
  266. data/src/nginx/src/http/ngx_http_script.c +1752 -0
  267. data/src/nginx/src/http/ngx_http_script.h +257 -0
  268. data/src/nginx/src/http/ngx_http_special_response.c +789 -0
  269. data/src/nginx/src/http/ngx_http_upstream.c +4555 -0
  270. data/src/nginx/src/http/ngx_http_upstream.h +350 -0
  271. data/src/nginx/src/http/ngx_http_upstream_round_robin.c +791 -0
  272. data/src/nginx/src/http/ngx_http_upstream_round_robin.h +85 -0
  273. data/src/nginx/src/http/ngx_http_variables.c +2053 -0
  274. data/src/nginx/src/http/ngx_http_variables.h +115 -0
  275. data/src/nginx/src/http/ngx_http_write_filter_module.c +315 -0
  276. data/src/nginx/src/mail/ngx_mail.c +542 -0
  277. data/src/nginx/src/mail/ngx_mail.h +407 -0
  278. data/src/nginx/src/mail/ngx_mail_auth_http_module.c +1452 -0
  279. data/src/nginx/src/mail/ngx_mail_core_module.c +553 -0
  280. data/src/nginx/src/mail/ngx_mail_handler.c +773 -0
  281. data/src/nginx/src/mail/ngx_mail_imap_handler.c +457 -0
  282. data/src/nginx/src/mail/ngx_mail_imap_module.c +253 -0
  283. data/src/nginx/src/mail/ngx_mail_imap_module.h +39 -0
  284. data/src/nginx/src/mail/ngx_mail_parse.c +885 -0
  285. data/src/nginx/src/mail/ngx_mail_pop3_handler.c +500 -0
  286. data/src/nginx/src/mail/ngx_mail_pop3_module.c +264 -0
  287. data/src/nginx/src/mail/ngx_mail_pop3_module.h +38 -0
  288. data/src/nginx/src/mail/ngx_mail_proxy_module.c +1089 -0
  289. data/src/nginx/src/mail/ngx_mail_smtp_handler.c +872 -0
  290. data/src/nginx/src/mail/ngx_mail_smtp_module.c +308 -0
  291. data/src/nginx/src/mail/ngx_mail_smtp_module.h +45 -0
  292. data/src/nginx/src/mail/ngx_mail_ssl_module.c +491 -0
  293. data/src/nginx/src/mail/ngx_mail_ssl_module.h +52 -0
  294. data/src/nginx/src/misc/ngx_cpp_test_module.cpp +27 -0
  295. data/src/nginx/src/misc/ngx_google_perftools_module.c +126 -0
  296. data/src/nginx/src/os/unix/ngx_aio_read.c +109 -0
  297. data/src/nginx/src/os/unix/ngx_aio_read_chain.c +78 -0
  298. data/src/nginx/src/os/unix/ngx_aio_write.c +109 -0
  299. data/src/nginx/src/os/unix/ngx_aio_write_chain.c +100 -0
  300. data/src/nginx/src/os/unix/ngx_alloc.c +90 -0
  301. data/src/nginx/src/os/unix/ngx_alloc.h +45 -0
  302. data/src/nginx/src/os/unix/ngx_atomic.h +311 -0
  303. data/src/nginx/src/os/unix/ngx_channel.c +258 -0
  304. data/src/nginx/src/os/unix/ngx_channel.h +34 -0
  305. data/src/nginx/src/os/unix/ngx_daemon.c +69 -0
  306. data/src/nginx/src/os/unix/ngx_darwin.h +20 -0
  307. data/src/nginx/src/os/unix/ngx_darwin_config.h +96 -0
  308. data/src/nginx/src/os/unix/ngx_darwin_init.c +166 -0
  309. data/src/nginx/src/os/unix/ngx_darwin_sendfile_chain.c +366 -0
  310. data/src/nginx/src/os/unix/ngx_errno.c +87 -0
  311. data/src/nginx/src/os/unix/ngx_errno.h +68 -0
  312. data/src/nginx/src/os/unix/ngx_file_aio_read.c +208 -0
  313. data/src/nginx/src/os/unix/ngx_files.c +566 -0
  314. data/src/nginx/src/os/unix/ngx_files.h +343 -0
  315. data/src/nginx/src/os/unix/ngx_freebsd.h +24 -0
  316. data/src/nginx/src/os/unix/ngx_freebsd_config.h +119 -0
  317. data/src/nginx/src/os/unix/ngx_freebsd_init.c +259 -0
  318. data/src/nginx/src/os/unix/ngx_freebsd_rfork_thread.c +756 -0
  319. data/src/nginx/src/os/unix/ngx_freebsd_rfork_thread.h +122 -0
  320. data/src/nginx/src/os/unix/ngx_freebsd_sendfile_chain.c +436 -0
  321. data/src/nginx/src/os/unix/ngx_gcc_atomic_amd64.h +82 -0
  322. data/src/nginx/src/os/unix/ngx_gcc_atomic_ppc.h +155 -0
  323. data/src/nginx/src/os/unix/ngx_gcc_atomic_sparc64.h +82 -0
  324. data/src/nginx/src/os/unix/ngx_gcc_atomic_x86.h +127 -0
  325. data/src/nginx/src/os/unix/ngx_linux.h +18 -0
  326. data/src/nginx/src/os/unix/ngx_linux_aio_read.c +137 -0
  327. data/src/nginx/src/os/unix/ngx_linux_config.h +117 -0
  328. data/src/nginx/src/os/unix/ngx_linux_init.c +91 -0
  329. data/src/nginx/src/os/unix/ngx_linux_sendfile_chain.c +378 -0
  330. data/src/nginx/src/os/unix/ngx_os.h +84 -0
  331. data/src/nginx/src/os/unix/ngx_posix_config.h +153 -0
  332. data/src/nginx/src/os/unix/ngx_posix_init.c +124 -0
  333. data/src/nginx/src/os/unix/ngx_process.c +590 -0
  334. data/src/nginx/src/os/unix/ngx_process.h +87 -0
  335. data/src/nginx/src/os/unix/ngx_process_cycle.c +1390 -0
  336. data/src/nginx/src/os/unix/ngx_process_cycle.h +61 -0
  337. data/src/nginx/src/os/unix/ngx_pthread_thread.c +278 -0
  338. data/src/nginx/src/os/unix/ngx_readv_chain.c +258 -0
  339. data/src/nginx/src/os/unix/ngx_recv.c +180 -0
  340. data/src/nginx/src/os/unix/ngx_send.c +73 -0
  341. data/src/nginx/src/os/unix/ngx_setproctitle.c +135 -0
  342. data/src/nginx/src/os/unix/ngx_setproctitle.h +52 -0
  343. data/src/nginx/src/os/unix/ngx_shmem.c +126 -0
  344. data/src/nginx/src/os/unix/ngx_shmem.h +29 -0
  345. data/src/nginx/src/os/unix/ngx_socket.c +116 -0
  346. data/src/nginx/src/os/unix/ngx_socket.h +64 -0
  347. data/src/nginx/src/os/unix/ngx_solaris.h +16 -0
  348. data/src/nginx/src/os/unix/ngx_solaris_config.h +107 -0
  349. data/src/nginx/src/os/unix/ngx_solaris_init.c +75 -0
  350. data/src/nginx/src/os/unix/ngx_solaris_sendfilev_chain.c +251 -0
  351. data/src/nginx/src/os/unix/ngx_sunpro_amd64.il +43 -0
  352. data/src/nginx/src/os/unix/ngx_sunpro_atomic_sparc64.h +61 -0
  353. data/src/nginx/src/os/unix/ngx_sunpro_sparc64.il +36 -0
  354. data/src/nginx/src/os/unix/ngx_sunpro_x86.il +44 -0
  355. data/src/nginx/src/os/unix/ngx_thread.h +128 -0
  356. data/src/nginx/src/os/unix/ngx_time.c +104 -0
  357. data/src/nginx/src/os/unix/ngx_time.h +66 -0
  358. data/src/nginx/src/os/unix/ngx_udp_recv.c +115 -0
  359. data/src/nginx/src/os/unix/ngx_user.c +109 -0
  360. data/src/nginx/src/os/unix/ngx_user.h +24 -0
  361. data/src/nginx/src/os/unix/ngx_writev_chain.c +181 -0
  362. data/src/nginx/src/os/unix/rfork_thread.S +73 -0
  363. metadata +419 -0
@@ -0,0 +1,8 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ have=NGX_SUPPRESS_WARN . auto/have
7
+
8
+ have=NGX_SMP . auto/have
@@ -0,0 +1,114 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ ### STUB
7
+
8
+ if [ $USE_THREADS != NO ]; then
9
+
10
+ cat << END
11
+
12
+ $0: error: the threads support is broken now.
13
+
14
+ END
15
+ exit 1
16
+ fi
17
+
18
+ ###
19
+
20
+
21
+ echo
22
+ echo "Configuration summary"
23
+
24
+
25
+ #case $USE_THREADS in
26
+ # rfork) echo " + using rfork()ed threads" ;;
27
+ # pthreads) echo " + using libpthread threads library" ;;
28
+ # libthr) echo " + using FreeBSD libthr threads library" ;;
29
+ # libc_r) echo " + using FreeBSD libc_r threads library" ;;
30
+ # linuxthreads) echo " + using FreeBSD LinuxThreads port library" ;;
31
+ # NO) echo " + threads are not used" ;;
32
+ # *) echo " + using lib$USE_THREADS threads library" ;;
33
+ #esac
34
+
35
+ if [ $USE_PCRE = DISABLED ]; then
36
+ echo " + PCRE library is disabled"
37
+
38
+ else
39
+ case $PCRE in
40
+ YES) echo " + using system PCRE library" ;;
41
+ NONE) echo " + PCRE library is not used" ;;
42
+ *) echo " + using PCRE library: $PCRE" ;;
43
+ esac
44
+ fi
45
+
46
+ case $OPENSSL in
47
+ YES) echo " + using system OpenSSL library" ;;
48
+ NONE) echo " + OpenSSL library is not used" ;;
49
+ *) echo " + using OpenSSL library: $OPENSSL" ;;
50
+ esac
51
+
52
+ case $MD5 in
53
+ YES) echo " + md5: using $MD5_LIB library" ;;
54
+ NONE) echo " + md5 library is not used" ;;
55
+ NO) echo " + using builtin md5 code" ;;
56
+ *) echo " + using md5 library: $MD5" ;;
57
+ esac
58
+
59
+ case $SHA1 in
60
+ YES) echo " + sha1: using $SHA1_LIB library" ;;
61
+ NONE) echo " + sha1 library is not used" ;;
62
+ NO) echo " + sha1 library is not found" ;;
63
+ *) echo " + using sha1 library: $SHA1" ;;
64
+ esac
65
+
66
+ case $ZLIB in
67
+ YES) echo " + using system zlib library" ;;
68
+ NONE) echo " + zlib library is not used" ;;
69
+ *) echo " + using zlib library: $ZLIB" ;;
70
+ esac
71
+
72
+ case $NGX_LIBATOMIC in
73
+ YES) echo " + using system libatomic_ops library" ;;
74
+ NO) ;; # not used
75
+ *) echo " + using libatomic_ops library: $NGX_LIBATOMIC" ;;
76
+ esac
77
+
78
+ echo
79
+
80
+
81
+ cat << END
82
+ nginx path prefix: "$NGX_PREFIX"
83
+ nginx binary file: "$NGX_SBIN_PATH"
84
+ nginx configuration prefix: "$NGX_CONF_PREFIX"
85
+ nginx configuration file: "$NGX_CONF_PATH"
86
+ nginx pid file: "$NGX_PID_PATH"
87
+ END
88
+
89
+ if test -n "$NGX_ERROR_LOG_PATH"; then
90
+ echo " nginx error log file: \"$NGX_ERROR_LOG_PATH\""
91
+ else
92
+ echo " nginx logs errors to stderr"
93
+ fi
94
+
95
+ cat << END
96
+ nginx http access log file: "$NGX_HTTP_LOG_PATH"
97
+ nginx http client request body temporary files: "$NGX_HTTP_CLIENT_TEMP_PATH"
98
+ END
99
+
100
+ if [ $HTTP_PROXY = YES ]; then
101
+ echo " nginx http proxy temporary files: \"$NGX_HTTP_PROXY_TEMP_PATH\""
102
+ fi
103
+
104
+ if [ $HTTP_FASTCGI = YES ]; then
105
+ echo " nginx http fastcgi temporary files: \"$NGX_HTTP_FASTCGI_TEMP_PATH\""
106
+ fi
107
+
108
+ if [ $HTTP_UWSGI = YES ]; then
109
+ echo " nginx http uwsgi temporary files: \"$NGX_HTTP_UWSGI_TEMP_PATH\""
110
+ fi
111
+
112
+ if [ $HTTP_SCGI = YES ]; then
113
+ echo " nginx http scgi temporary files: \"$NGX_HTTP_SCGI_TEMP_PATH\""
114
+ fi
@@ -0,0 +1,83 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ echo $ngx_n "checking for $ngx_type size ...$ngx_c"
7
+
8
+ cat << END >> $NGX_AUTOCONF_ERR
9
+
10
+ ----------------------------------------
11
+ checking for $ngx_type size
12
+
13
+ END
14
+
15
+ ngx_size=
16
+
17
+ cat << END > $NGX_AUTOTEST.c
18
+
19
+ #include <sys/types.h>
20
+ #include <sys/time.h>
21
+ $NGX_INCLUDE_UNISTD_H
22
+ #include <signal.h>
23
+ #include <sys/resource.h>
24
+ $NGX_INCLUDE_INTTYPES_H
25
+ $NGX_INCLUDE_AUTO_CONFIG_H
26
+
27
+ int main() {
28
+ printf("%d", sizeof($ngx_type));
29
+ return 0;
30
+ }
31
+
32
+ END
33
+
34
+
35
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
36
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
37
+
38
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
39
+
40
+
41
+ if [ -x $NGX_AUTOTEST ]; then
42
+ ngx_size=`$NGX_AUTOTEST`
43
+ echo " $ngx_size bytes"
44
+ fi
45
+
46
+
47
+ rm -f $NGX_AUTOTEST
48
+
49
+
50
+ case $ngx_size in
51
+ 4)
52
+ if [ "$ngx_type"="long" ]; then
53
+ ngx_max_value=2147483647L
54
+ else
55
+ ngx_max_value=2147483647
56
+ fi
57
+
58
+ ngx_max_len='(sizeof("-2147483648") - 1)'
59
+ ;;
60
+
61
+ 8)
62
+ if [ "$ngx_type"="long long" ]; then
63
+ ngx_max_value=9223372036854775807LL
64
+ else
65
+ ngx_max_value=9223372036854775807L
66
+ fi
67
+
68
+ ngx_max_len='(sizeof("-9223372036854775808") - 1)'
69
+ ;;
70
+
71
+ *)
72
+ echo
73
+ echo "$0: error: can not detect $ngx_type size"
74
+
75
+ echo "----------" >> $NGX_AUTOCONF_ERR
76
+ cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
77
+ echo "----------" >> $NGX_AUTOCONF_ERR
78
+ echo $ngx_test >> $NGX_AUTOCONF_ERR
79
+ echo "----------" >> $NGX_AUTOCONF_ERR
80
+
81
+ exit 1
82
+ esac
83
+
@@ -0,0 +1,77 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ echo $ngx_n "checking for $ngx_type ...$ngx_c"
7
+
8
+ cat << END >> $NGX_AUTOCONF_ERR
9
+
10
+ ----------------------------------------
11
+ checking for $ngx_type
12
+
13
+ END
14
+
15
+ ngx_found=no
16
+
17
+ for ngx_try in $ngx_type $ngx_types
18
+ do
19
+
20
+ cat << END > $NGX_AUTOTEST.c
21
+
22
+ #include <sys/types.h>
23
+ #include <signal.h>
24
+ #include <sys/socket.h>
25
+ #include <sys/time.h>
26
+ #include <sys/resource.h>
27
+ #include <netinet/in.h>
28
+ $NGX_INCLUDE_INTTYPES_H
29
+
30
+ int main() {
31
+ $ngx_try i = 0;
32
+ return 0;
33
+ }
34
+
35
+ END
36
+
37
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
38
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
39
+
40
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
41
+
42
+ if [ -x $NGX_AUTOTEST ]; then
43
+ if [ $ngx_try = $ngx_type ]; then
44
+ echo " found"
45
+ ngx_found=yes
46
+ else
47
+ echo ", $ngx_try used"
48
+ ngx_found=$ngx_try
49
+ fi
50
+ fi
51
+
52
+ rm -f $NGX_AUTOTEST
53
+
54
+ if [ $ngx_found = no ]; then
55
+ echo $ngx_n " $ngx_try not found$ngx_c"
56
+
57
+ echo "----------" >> $NGX_AUTOCONF_ERR
58
+ cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
59
+ echo "----------" >> $NGX_AUTOCONF_ERR
60
+ echo $ngx_test >> $NGX_AUTOCONF_ERR
61
+ echo "----------" >> $NGX_AUTOCONF_ERR
62
+
63
+ else
64
+ break
65
+ fi
66
+ done
67
+
68
+ if [ $ngx_found = no ]; then
69
+ echo
70
+ echo "$0: error: can not define $ngx_type"
71
+
72
+ exit 1
73
+ fi
74
+
75
+ if [ $ngx_found != yes ]; then
76
+ echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H
77
+ fi
@@ -0,0 +1,42 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ echo $ngx_n "checking for uintptr_t ...$ngx_c"
7
+ echo >> $NGX_ERR
8
+ echo "checking for uintptr_t" >> $NGX_ERR
9
+
10
+ found=no
11
+
12
+ cat << END > $NGX_AUTOTEST.c
13
+
14
+ #include <sys/types.h>
15
+ $NGX_INTTYPES_H
16
+
17
+ int main() {
18
+ uintptr_t i = 0;
19
+ return 0;
20
+ }
21
+
22
+ END
23
+
24
+ eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
25
+
26
+ if [ -x $NGX_AUTOTEST ]; then
27
+ echo " uintptr_t found"
28
+ found=yes
29
+ else
30
+ echo $ngx_n " uintptr_t not found" $ngx_c
31
+ fi
32
+
33
+ rm $NGX_AUTOTEST*
34
+
35
+
36
+ if [ $found = no ]; then
37
+ found="uint`expr 8 \* $ngx_ptr_size`_t"
38
+ echo ", $found used"
39
+
40
+ echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H
41
+ echo "typedef $found intptr_t;" | sed -e 's/u//g' >> $NGX_AUTO_CONFIG_H
42
+ fi
@@ -0,0 +1,12 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ cat << END >> $NGX_AUTO_CONFIG_H
7
+
8
+ #ifndef $ngx_param
9
+ #define $ngx_param $ngx_value
10
+ #endif
11
+
12
+ END
@@ -0,0 +1,719 @@
1
+
2
+ # Copyright (C) Igor Sysoev
3
+ # Copyright (C) Nginx, Inc.
4
+
5
+
6
+ NGX_USER=${NGX_USER:-nobody}
7
+
8
+ if [ -z "$NGX_GROUP" ]; then
9
+ if [ $NGX_USER = nobody ]; then
10
+ if grep nobody /etc/group 2>&1 >/dev/null; then
11
+ echo "checking for nobody group ... found"
12
+ NGX_GROUP=nobody
13
+ else
14
+ echo "checking for nobody group ... not found"
15
+
16
+ if grep nogroup /etc/group 2>&1 >/dev/null; then
17
+ echo "checking for nogroup group ... found"
18
+ NGX_GROUP=nogroup
19
+ else
20
+ echo "checking for nogroup group ... not found"
21
+ NGX_GROUP=nobody
22
+ fi
23
+ fi
24
+ else
25
+ NGX_GROUP=$NGX_USER
26
+ fi
27
+ fi
28
+
29
+
30
+ ngx_feature="poll()"
31
+ ngx_feature_name=
32
+ ngx_feature_run=no
33
+ ngx_feature_incs="#include <poll.h>"
34
+ ngx_feature_path=
35
+ ngx_feature_libs=
36
+ ngx_feature_test="int n, dp; struct pollfd pl;
37
+ dp = 0;
38
+ pl.fd = 0;
39
+ pl.events = 0;
40
+ pl.revents = 0;
41
+ n = poll(&pl, 1, 0)"
42
+ . auto/feature
43
+
44
+ if [ $ngx_found = no ]; then
45
+ EVENT_POLL=NONE
46
+ fi
47
+
48
+
49
+ ngx_feature="/dev/poll"
50
+ ngx_feature_name="NGX_HAVE_DEVPOLL"
51
+ ngx_feature_run=no
52
+ ngx_feature_incs="#include <sys/devpoll.h>"
53
+ ngx_feature_path=
54
+ ngx_feature_libs=
55
+ ngx_feature_test="int n, dp; struct dvpoll dvp;
56
+ dp = 0;
57
+ dvp.dp_fds = NULL;
58
+ dvp.dp_nfds = 0;
59
+ dvp.dp_timeout = 0;
60
+ n = ioctl(dp, DP_POLL, &dvp)"
61
+ . auto/feature
62
+
63
+ if [ $ngx_found = yes ]; then
64
+ CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
65
+ EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
66
+ EVENT_FOUND=YES
67
+ fi
68
+
69
+
70
+ if test -z "$NGX_KQUEUE_CHECKED"; then
71
+ ngx_feature="kqueue"
72
+ ngx_feature_name="NGX_HAVE_KQUEUE"
73
+ ngx_feature_run=no
74
+ ngx_feature_incs="#include <sys/event.h>"
75
+ ngx_feature_path=
76
+ ngx_feature_libs=
77
+ ngx_feature_test="int kq; kq = kqueue()"
78
+ . auto/feature
79
+
80
+ if [ $ngx_found = yes ]; then
81
+
82
+ have=NGX_HAVE_CLEAR_EVENT . auto/have
83
+ EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
84
+ CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
85
+ EVENT_FOUND=YES
86
+
87
+ ngx_feature="kqueue's NOTE_LOWAT"
88
+ ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
89
+ ngx_feature_run=no
90
+ ngx_feature_incs="#include <sys/event.h>"
91
+ ngx_feature_path=
92
+ ngx_feature_libs=
93
+ ngx_feature_test="struct kevent kev;
94
+ kev.fflags = NOTE_LOWAT;"
95
+ . auto/feature
96
+
97
+
98
+ ngx_feature="kqueue's EVFILT_TIMER"
99
+ ngx_feature_name="NGX_HAVE_TIMER_EVENT"
100
+ ngx_feature_run=yes
101
+ ngx_feature_incs="#include <sys/event.h>
102
+ #include <sys/time.h>"
103
+ ngx_feature_path=
104
+ ngx_feature_libs=
105
+ ngx_feature_test="int kq;
106
+ struct kevent kev;
107
+ struct timespec ts;
108
+
109
+ if ((kq = kqueue()) == -1) return 1;
110
+
111
+ kev.ident = 0;
112
+ kev.filter = EVFILT_TIMER;
113
+ kev.flags = EV_ADD|EV_ENABLE;
114
+ kev.fflags = 0;
115
+ kev.data = 1000;
116
+ kev.udata = 0;
117
+
118
+ ts.tv_sec = 0;
119
+ ts.tv_nsec = 0;
120
+
121
+ if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
122
+
123
+ if (kev.flags & EV_ERROR) return 1;"
124
+
125
+ . auto/feature
126
+ fi
127
+ fi
128
+
129
+
130
+ if [ "$NGX_SYSTEM" = "NetBSD" ]; then
131
+
132
+ # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
133
+
134
+ cat << END >> $NGX_AUTO_CONFIG_H
135
+
136
+ #define NGX_KQUEUE_UDATA_T
137
+
138
+ END
139
+
140
+ else
141
+ cat << END >> $NGX_AUTO_CONFIG_H
142
+
143
+ #define NGX_KQUEUE_UDATA_T (void *)
144
+
145
+ END
146
+
147
+ fi
148
+
149
+
150
+ ngx_feature="crypt()"
151
+ ngx_feature_name=
152
+ ngx_feature_run=no
153
+ ngx_feature_incs=
154
+ ngx_feature_path=
155
+ ngx_feature_libs=
156
+ ngx_feature_test="crypt(\"test\", \"salt\");"
157
+ . auto/feature
158
+
159
+
160
+ if [ $ngx_found = no ]; then
161
+
162
+ ngx_feature="crypt() in libcrypt"
163
+ ngx_feature_name=
164
+ ngx_feature_run=no
165
+ ngx_feature_incs=
166
+ ngx_feature_path=
167
+ ngx_feature_libs=-lcrypt
168
+ . auto/feature
169
+
170
+ if [ $ngx_found = yes ]; then
171
+ CRYPT_LIB="-lcrypt"
172
+ fi
173
+ fi
174
+
175
+
176
+ ngx_feature="F_READAHEAD"
177
+ ngx_feature_name="NGX_HAVE_F_READAHEAD"
178
+ ngx_feature_run=no
179
+ ngx_feature_incs="#include <fcntl.h>"
180
+ ngx_feature_path=
181
+ ngx_feature_libs=
182
+ ngx_feature_test="fcntl(0, F_READAHEAD, 1);"
183
+ . auto/feature
184
+
185
+
186
+ ngx_feature="posix_fadvise()"
187
+ ngx_feature_name="NGX_HAVE_POSIX_FADVISE"
188
+ ngx_feature_run=no
189
+ ngx_feature_incs="#include <fcntl.h>"
190
+ ngx_feature_path=
191
+ ngx_feature_libs=
192
+ ngx_feature_test="posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL);"
193
+ . auto/feature
194
+
195
+
196
+ ngx_feature="O_DIRECT"
197
+ ngx_feature_name="NGX_HAVE_O_DIRECT"
198
+ ngx_feature_run=no
199
+ ngx_feature_incs="#include <fcntl.h>"
200
+ ngx_feature_path=
201
+ ngx_feature_libs=
202
+ ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
203
+ . auto/feature
204
+
205
+
206
+ if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
207
+ have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
208
+ fi
209
+
210
+ ngx_feature="F_NOCACHE"
211
+ ngx_feature_name="NGX_HAVE_F_NOCACHE"
212
+ ngx_feature_run=no
213
+ ngx_feature_incs="#include <fcntl.h>"
214
+ ngx_feature_path=
215
+ ngx_feature_libs=
216
+ ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
217
+ . auto/feature
218
+
219
+
220
+ ngx_feature="directio()"
221
+ ngx_feature_name="NGX_HAVE_DIRECTIO"
222
+ ngx_feature_run=no
223
+ ngx_feature_incs="#include <sys/types.h>
224
+ #include <sys/fcntl.h>"
225
+ ngx_feature_path=
226
+ ngx_feature_libs=
227
+ ngx_feature_test="directio(0, DIRECTIO_ON);"
228
+ . auto/feature
229
+
230
+
231
+ ngx_feature="statfs()"
232
+ ngx_feature_name="NGX_HAVE_STATFS"
233
+ ngx_feature_run=no
234
+ ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
235
+ $NGX_INCLUDE_SYS_MOUNT_H
236
+ $NGX_INCLUDE_SYS_VFS_H"
237
+ ngx_feature_path=
238
+ ngx_feature_libs=
239
+ ngx_feature_test="struct statfs fs;
240
+ statfs(NULL, &fs);"
241
+ . auto/feature
242
+
243
+
244
+ ngx_feature="statvfs()"
245
+ ngx_feature_name="NGX_HAVE_STATVFS"
246
+ ngx_feature_run=no
247
+ ngx_feature_incs="#include <sys/types.h>
248
+ #include <sys/statvfs.h>"
249
+ ngx_feature_path=
250
+ ngx_feature_libs=
251
+ ngx_feature_test="struct statvfs fs;
252
+ statvfs(NULL, &fs);"
253
+ . auto/feature
254
+
255
+
256
+ ngx_feature="dlopen()"
257
+ ngx_feature_name=
258
+ ngx_feature_run=no
259
+ ngx_feature_incs="#include <dlfcn.h>"
260
+ ngx_feature_path=
261
+ ngx_feature_libs=
262
+ ngx_feature_test="dlopen(NULL, 0)"
263
+ . auto/feature
264
+
265
+
266
+ if [ $ngx_found != yes ]; then
267
+
268
+ ngx_feature="dlopen() in libdl"
269
+ ngx_feature_libs="-ldl"
270
+ . auto/feature
271
+
272
+ if [ $ngx_found = yes ]; then
273
+ NGX_LIBDL="-ldl"
274
+ fi
275
+ fi
276
+
277
+
278
+ ngx_feature="sched_yield()"
279
+ ngx_feature_name="NGX_HAVE_SCHED_YIELD"
280
+ ngx_feature_run=no
281
+ ngx_feature_incs="#include <sched.h>"
282
+ ngx_feature_path=
283
+ ngx_feature_libs=
284
+ ngx_feature_test="sched_yield()"
285
+ . auto/feature
286
+
287
+
288
+ if [ $ngx_found != yes ]; then
289
+
290
+ ngx_feature="sched_yield() in librt"
291
+ ngx_feature_libs="-lrt"
292
+ . auto/feature
293
+
294
+ if [ $ngx_found = yes ]; then
295
+ CORE_LIBS="$CORE_LIBS -lrt"
296
+ fi
297
+ fi
298
+
299
+
300
+ ngx_feature="SO_SETFIB"
301
+ ngx_feature_name="NGX_HAVE_SETFIB"
302
+ ngx_feature_run=no
303
+ ngx_feature_incs="#include <sys/socket.h>"
304
+ ngx_feature_path=
305
+ ngx_feature_libs=
306
+ ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
307
+ . auto/feature
308
+
309
+
310
+ ngx_feature="SO_ACCEPTFILTER"
311
+ ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
312
+ ngx_feature_run=no
313
+ ngx_feature_incs="#include <sys/socket.h>"
314
+ ngx_feature_path=
315
+ ngx_feature_libs=
316
+ ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
317
+ . auto/feature
318
+
319
+
320
+ ngx_feature="TCP_DEFER_ACCEPT"
321
+ ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
322
+ ngx_feature_run=no
323
+ ngx_feature_incs="#include <sys/socket.h>
324
+ #include <netinet/in.h>
325
+ #include <netinet/tcp.h>"
326
+ ngx_feature_path=
327
+ ngx_feature_libs=
328
+ ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
329
+ . auto/feature
330
+
331
+
332
+ ngx_feature="accept4()"
333
+ ngx_feature_name="NGX_HAVE_ACCEPT4"
334
+ ngx_feature_run=no
335
+ ngx_feature_incs="#include <sys/socket.h>"
336
+ ngx_feature_path=
337
+ ngx_feature_libs=
338
+ ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
339
+ . auto/feature
340
+
341
+ if [ $NGX_FILE_AIO = YES ]; then
342
+
343
+ ngx_feature="kqueue AIO support"
344
+ ngx_feature_name="NGX_HAVE_FILE_AIO"
345
+ ngx_feature_run=no
346
+ ngx_feature_incs="#include <aio.h>"
347
+ ngx_feature_path=
348
+ ngx_feature_libs=
349
+ ngx_feature_test="int n; struct aiocb iocb;
350
+ iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
351
+ n = aio_read(&iocb)"
352
+ . auto/feature
353
+
354
+ if [ $ngx_found = yes ]; then
355
+ CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
356
+
357
+ elif [ $ngx_found = no ]; then
358
+
359
+ ngx_feature="Linux AIO support"
360
+ ngx_feature_name="NGX_HAVE_FILE_AIO"
361
+ ngx_feature_run=no
362
+ ngx_feature_incs="#include <linux/aio_abi.h>
363
+ #include <sys/syscall.h>"
364
+ ngx_feature_path=
365
+ ngx_feature_libs=
366
+ ngx_feature_test="int n = SYS_eventfd;
367
+ struct iocb iocb;
368
+ iocb.aio_lio_opcode = IOCB_CMD_PREAD;
369
+ iocb.aio_flags = IOCB_FLAG_RESFD;
370
+ iocb.aio_resfd = -1;"
371
+ . auto/feature
372
+
373
+ if [ $ngx_found = yes ]; then
374
+ have=NGX_HAVE_EVENTFD . auto/have
375
+ CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
376
+
377
+ else
378
+ cat << END
379
+
380
+ $0: no supported file AIO was found
381
+ Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
382
+
383
+ END
384
+ exit 1
385
+ fi
386
+ fi
387
+ fi
388
+
389
+
390
+ have=NGX_HAVE_UNIX_DOMAIN . auto/have
391
+
392
+ ngx_feature_libs=
393
+
394
+
395
+ # C types
396
+
397
+ ngx_type="int"; . auto/types/sizeof
398
+
399
+ ngx_type="long"; . auto/types/sizeof
400
+
401
+ ngx_type="long long"; . auto/types/sizeof
402
+
403
+ ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
404
+ ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
405
+
406
+
407
+ # POSIX types
408
+
409
+ case "$NGX_AUTO_CONFIG_H" in
410
+ /*)
411
+ NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
412
+ ;;
413
+ *)
414
+ NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
415
+ ;;
416
+ esac
417
+
418
+ ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
419
+
420
+ ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
421
+ . auto/types/sizeof
422
+ ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
423
+
424
+ ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
425
+
426
+ ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
427
+
428
+ ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
429
+
430
+ ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
431
+
432
+ . auto/types/uintptr_t
433
+
434
+ . auto/endianess
435
+
436
+ ngx_type="size_t"; . auto/types/sizeof
437
+ ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
438
+ ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
439
+
440
+ ngx_type="off_t"; . auto/types/sizeof
441
+ ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
442
+ ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
443
+
444
+ ngx_type="time_t"; . auto/types/sizeof
445
+ ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
446
+ ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
447
+
448
+
449
+ # syscalls, libc calls and some features
450
+
451
+
452
+ if [ $NGX_IPV6 = YES ]; then
453
+ ngx_feature="AF_INET6"
454
+ ngx_feature_name="NGX_HAVE_INET6"
455
+ ngx_feature_run=no
456
+ ngx_feature_incs="#include <sys/socket.h>
457
+ #include <netinet/in.h>
458
+ #include <arpa/inet.h>"
459
+ ngx_feature_path=
460
+ ngx_feature_libs=
461
+ ngx_feature_test="struct sockaddr_in6 sin6;
462
+ sin6.sin6_family = AF_INET6;"
463
+ . auto/feature
464
+ fi
465
+
466
+
467
+ ngx_feature="setproctitle()"
468
+ ngx_feature_name="NGX_HAVE_SETPROCTITLE"
469
+ ngx_feature_run=no
470
+ ngx_feature_incs=
471
+ ngx_feature_path=
472
+ ngx_feature_libs=$NGX_SETPROCTITLE_LIB
473
+ ngx_feature_test="setproctitle(\"test\");"
474
+ . auto/feature
475
+
476
+
477
+ ngx_feature="pread()"
478
+ ngx_feature_name="NGX_HAVE_PREAD"
479
+ ngx_feature_run=no
480
+ ngx_feature_incs=
481
+ ngx_feature_path=
482
+ ngx_feature_libs=
483
+ ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0)"
484
+ . auto/feature
485
+
486
+
487
+ ngx_feature="pwrite()"
488
+ ngx_feature_name="NGX_HAVE_PWRITE"
489
+ ngx_feature_run=no
490
+ ngx_feature_incs=
491
+ ngx_feature_path=
492
+ ngx_feature_libs=
493
+ ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
494
+ . auto/feature
495
+
496
+
497
+ ngx_feature="sys_nerr"
498
+ ngx_feature_name="NGX_SYS_NERR"
499
+ ngx_feature_run=value
500
+ ngx_feature_incs='#include <errno.h>
501
+ #include <stdio.h>'
502
+ ngx_feature_path=
503
+ ngx_feature_libs=
504
+ ngx_feature_test='printf("%d", sys_nerr);'
505
+ . auto/feature
506
+
507
+
508
+ if [ $ngx_found = no ]; then
509
+
510
+ # Cygiwn defines _sys_nerr
511
+ ngx_feature="_sys_nerr"
512
+ ngx_feature_name="NGX_SYS_NERR"
513
+ ngx_feature_run=value
514
+ ngx_feature_incs='#include <errno.h>
515
+ #include <stdio.h>'
516
+ ngx_feature_path=
517
+ ngx_feature_libs=
518
+ ngx_feature_test='printf("%d", _sys_nerr);'
519
+ . auto/feature
520
+ fi
521
+
522
+
523
+ if [ $ngx_found = no ]; then
524
+
525
+ # Solaris has no sys_nerr
526
+ ngx_feature='maximum errno'
527
+ ngx_feature_name=NGX_SYS_NERR
528
+ ngx_feature_run=value
529
+ ngx_feature_incs='#include <errno.h>
530
+ #include <string.h>
531
+ #include <stdio.h>'
532
+ ngx_feature_path=
533
+ ngx_feature_libs=
534
+ ngx_feature_test='int n;
535
+ char *p;
536
+ for (n = 1; n < 1000; n++) {
537
+ errno = 0;
538
+ p = strerror(n);
539
+ if (errno == EINVAL
540
+ || p == NULL
541
+ || strncmp(p, "Unknown error", 13) == 0)
542
+ {
543
+ break;
544
+ }
545
+ }
546
+ printf("%d", n);'
547
+ . auto/feature
548
+ fi
549
+
550
+
551
+ ngx_feature="localtime_r()"
552
+ ngx_feature_name="NGX_HAVE_LOCALTIME_R"
553
+ ngx_feature_run=no
554
+ ngx_feature_incs="#include <time.h>"
555
+ ngx_feature_path=
556
+ ngx_feature_libs=
557
+ ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
558
+ . auto/feature
559
+
560
+
561
+ ngx_feature="posix_memalign()"
562
+ ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
563
+ ngx_feature_run=no
564
+ ngx_feature_incs="#include <stdlib.h>"
565
+ ngx_feature_path=
566
+ ngx_feature_libs=
567
+ ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096)"
568
+ . auto/feature
569
+
570
+
571
+ ngx_feature="memalign()"
572
+ ngx_feature_name="NGX_HAVE_MEMALIGN"
573
+ ngx_feature_run=no
574
+ ngx_feature_incs="#include <stdlib.h>"
575
+ ngx_feature_path=
576
+ ngx_feature_libs=
577
+ ngx_feature_test="void *p; p = memalign(4096, 4096)"
578
+ . auto/feature
579
+
580
+
581
+ ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
582
+ ngx_feature_name="NGX_HAVE_MAP_ANON"
583
+ ngx_feature_run=yes
584
+ ngx_feature_incs="#include <sys/mman.h>"
585
+ ngx_feature_path=
586
+ ngx_feature_libs=
587
+ ngx_feature_test="void *p;
588
+ p = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
589
+ MAP_ANON|MAP_SHARED, -1, 0);
590
+ if (p == MAP_FAILED) return 1;"
591
+ . auto/feature
592
+
593
+
594
+ ngx_feature='mmap("/dev/zero", MAP_SHARED)'
595
+ ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
596
+ ngx_feature_run=yes
597
+ ngx_feature_incs="#include <sys/mman.h>
598
+ #include <sys/stat.h>
599
+ #include <fcntl.h>"
600
+ ngx_feature_path=
601
+ ngx_feature_libs=
602
+ ngx_feature_test='void *p; int fd;
603
+ fd = open("/dev/zero", O_RDWR);
604
+ p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
605
+ if (p == MAP_FAILED) return 1;'
606
+ . auto/feature
607
+
608
+
609
+ ngx_feature="System V shared memory"
610
+ ngx_feature_name="NGX_HAVE_SYSVSHM"
611
+ ngx_feature_run=yes
612
+ ngx_feature_incs="#include <sys/ipc.h>
613
+ #include <sys/shm.h>"
614
+ ngx_feature_path=
615
+ ngx_feature_libs=
616
+ ngx_feature_test="int id;
617
+ id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT));
618
+ if (id == -1) return 1;
619
+ shmctl(id, IPC_RMID, NULL);"
620
+ . auto/feature
621
+
622
+
623
+ ngx_feature="POSIX semaphores"
624
+ ngx_feature_name="NGX_HAVE_POSIX_SEM"
625
+ ngx_feature_run=yes
626
+ ngx_feature_incs="#include <semaphore.h>"
627
+ ngx_feature_path=
628
+ ngx_feature_libs=
629
+ ngx_feature_test="sem_t sem;
630
+ if (sem_init(&sem, 1, 0) == -1) return 1;
631
+ sem_destroy(&sem);"
632
+ . auto/feature
633
+
634
+
635
+ if [ $ngx_found = no ]; then
636
+
637
+ # Linux has POSIX semaphores in libpthread
638
+ ngx_feature="POSIX semaphores in libpthread"
639
+ ngx_feature_libs=-lpthread
640
+ . auto/feature
641
+
642
+ if [ $ngx_found = yes ]; then
643
+ CORE_LIBS="$CORE_LIBS -lpthread"
644
+ fi
645
+ fi
646
+
647
+
648
+ if [ $ngx_found = no ]; then
649
+
650
+ # Solaris has POSIX semaphores in librt
651
+ ngx_feature="POSIX semaphores in librt"
652
+ ngx_feature_libs=-lrt
653
+ . auto/feature
654
+
655
+ if [ $ngx_found = yes ]; then
656
+ CORE_LIBS="$CORE_LIBS -lrt"
657
+ fi
658
+ fi
659
+
660
+
661
+ ngx_feature="struct msghdr.msg_control"
662
+ ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
663
+ ngx_feature_run=no
664
+ ngx_feature_incs="#include <sys/socket.h>"
665
+ ngx_feature_path=
666
+ ngx_feature_libs=
667
+ ngx_feature_test="struct msghdr msg; msg.msg_control = NULL"
668
+ . auto/feature
669
+
670
+
671
+ ngx_feature="ioctl(FIONBIO)"
672
+ ngx_feature_name="NGX_HAVE_FIONBIO"
673
+ ngx_feature_run=no
674
+ ngx_feature_incs="#include <sys/ioctl.h>
675
+ $NGX_INCLUDE_SYS_FILIO_H"
676
+ ngx_feature_path=
677
+ ngx_feature_libs=
678
+ ngx_feature_test="int i; i = FIONBIO"
679
+ . auto/feature
680
+
681
+
682
+ ngx_feature="struct tm.tm_gmtoff"
683
+ ngx_feature_name="NGX_HAVE_GMTOFF"
684
+ ngx_feature_run=no
685
+ ngx_feature_incs="#include <time.h>"
686
+ ngx_feature_path=
687
+ ngx_feature_libs=
688
+ ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0"
689
+ . auto/feature
690
+
691
+
692
+ ngx_feature="struct dirent.d_namlen"
693
+ ngx_feature_name="NGX_HAVE_D_NAMLEN"
694
+ ngx_feature_run=no
695
+ ngx_feature_incs="#include <dirent.h>"
696
+ ngx_feature_path=
697
+ ngx_feature_libs=
698
+ ngx_feature_test="struct dirent dir; dir.d_namlen = 0"
699
+ . auto/feature
700
+
701
+
702
+ ngx_feature="struct dirent.d_type"
703
+ ngx_feature_name="NGX_HAVE_D_TYPE"
704
+ ngx_feature_run=no
705
+ ngx_feature_incs="#include <dirent.h>"
706
+ ngx_feature_path=
707
+ ngx_feature_libs=
708
+ ngx_feature_test="struct dirent dir; dir.d_type = DT_REG"
709
+ . auto/feature
710
+
711
+
712
+ ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
713
+ ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
714
+ ngx_feature_run=no
715
+ ngx_feature_incs=
716
+ ngx_feature_path=
717
+ ngx_feature_libs=
718
+ ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
719
+ . auto/feature