diff src/os/unix/ngx_posix_init.c @ 449:3b1e8c9df9ad

nginx-0.1.0-2004-10-04-00:02:06 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 03 Oct 2004 20:02:06 +0000
parents 42d11f017717
children 295d97d70c69
line wrap: on
line diff
--- a/src/os/unix/ngx_posix_init.c
+++ b/src/os/unix/ngx_posix_init.c
@@ -8,9 +8,12 @@
 #include <ngx_core.h>
 
 
-int  ngx_ncpu;
-int  ngx_max_sockets;
-int  ngx_inherited_nonblocking;
+ngx_int_t  ngx_ncpu;
+ngx_int_t  ngx_max_sockets;
+ngx_int_t  ngx_inherited_nonblocking;
+
+
+struct rlimit  rlmt;
 
 
 #if (NGX_POSIX_IO)
@@ -82,10 +85,9 @@ ngx_signal_t  signals[] = {
 };
 
 
-int ngx_posix_init(ngx_log_t *log)
+ngx_int_t ngx_posix_init(ngx_log_t *log)
 {
     ngx_signal_t      *sig;
-    struct rlimit      rlmt;
     struct sigaction   sa;
 
     ngx_pagesize = getpagesize();
@@ -111,10 +113,6 @@ int ngx_posix_init(ngx_log_t *log)
         return NGX_ERROR;
     }
 
-    ngx_log_error(NGX_LOG_INFO, log, 0,
-                  "getrlimit(RLIMIT_NOFILE): " RLIM_T_FMT ":" RLIM_T_FMT,
-                  rlmt.rlim_cur, rlmt.rlim_max);
-
     ngx_max_sockets = rlmt.rlim_cur;
 
 #if (HAVE_INHERITED_NONBLOCK)
@@ -127,6 +125,14 @@ int ngx_posix_init(ngx_log_t *log)
 }
 
 
+void ngx_posix_status(ngx_log_t *log)
+{
+    ngx_log_error(NGX_LOG_INFO, log, 0,
+                  "getrlimit(RLIMIT_NOFILE): " RLIM_T_FMT ":" RLIM_T_FMT,
+                  rlmt.rlim_cur, rlmt.rlim_max);
+}
+
+
 void ngx_signal_handler(int signo)
 {
     char            *action;