aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_unix_init.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-05-19 16:39:14 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-05-19 16:39:14 +0000
commita98301160de4c12f455cca8f78509f2e04626c0b (patch)
treecdf14046298d40ca8398925603fb4011360b187a /src/os/unix/ngx_unix_init.c
parentbb4ec5c1721defd7b10f83ace51bddb71726dd1a (diff)
downloadnginx-a98301160de4c12f455cca8f78509f2e04626c0b.tar.gz
nginx-a98301160de4c12f455cca8f78509f2e04626c0b.zip
nginx-0.0.1-2003-05-19-20:39:14 import
Diffstat (limited to 'src/os/unix/ngx_unix_init.c')
-rw-r--r--src/os/unix/ngx_unix_init.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/os/unix/ngx_unix_init.c b/src/os/unix/ngx_unix_init.c
new file mode 100644
index 000000000..2916c9e44
--- /dev/null
+++ b/src/os/unix/ngx_unix_init.c
@@ -0,0 +1,39 @@
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
+int ngx_unix_init(ngx_log_t *log)
+{
+ struct sigaction sa;
+ struct rlimit rlmt;
+
+ ngx_memzero(&sa, sizeof(struct sigaction));
+ sa.sa_handler = SIG_IGN;
+ sigemptyset(&sa.sa_mask);
+
+ if (sigaction(SIGPIPE, &sa, NULL) == -1) {
+ ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
+ "sigaction(SIGPIPE, SIG_IGN) failed");
+ return NGX_ERROR;
+ }
+
+
+ if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
+ ngx_log_error(NGX_LOG_ALERT, log, errno,
+ "getrlimit(RLIMIT_NOFILE) failed)");
+ return NGX_ERROR;
+ }
+
+ ngx_log_error(NGX_LOG_INFO, log, 0,
+ "getrlimit(RLIMIT_NOFILE): %qd:%qd",
+ rlmt.rlim_cur, rlmt.rlim_max);
+
+
+#if 0
+ RLIM_INFINITY
+ max_connections =< rlmt.rlim_cur;
+#endif
+
+ return NGX_OK;
+}