diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-05-12 15:52:24 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-05-12 15:52:24 +0000 |
commit | 6b863e353d54420c323d67f86aad0b90ba04e316 (patch) | |
tree | 51d13ab529d2605be3995333d71344c917c5c4f4 /src/os/unix/ngx_init.c | |
parent | 4fe262b6821a461b3dbb3d6bfd05a8f713157524 (diff) | |
download | nginx-6b863e353d54420c323d67f86aad0b90ba04e316.tar.gz nginx-6b863e353d54420c323d67f86aad0b90ba04e316.zip |
nginx-0.0.1-2003-05-12-19:52:24 import
Diffstat (limited to 'src/os/unix/ngx_init.c')
-rw-r--r-- | src/os/unix/ngx_init.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/os/unix/ngx_init.c b/src/os/unix/ngx_init.c new file mode 100644 index 000000000..28af1288d --- /dev/null +++ b/src/os/unix/ngx_init.c @@ -0,0 +1,20 @@ + + +int ngx_unix_init(ngx_log_t *log) +{ + struct rlimit rlmt; + + 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): %d", rlmt.rlim_cur); + + RLIM_INFINITY + max_connections =< rlmt.rlim_cur; + + return NGX_OK; +} |