Mercurial > hg > nginx
comparison src/os/unix/ngx_unix_init.c @ 91:637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 19 May 2003 16:39:14 +0000 |
parents | src/os/unix/ngx_init.c@3973260705cc |
children | 19cc647ecd91 |
comparison
equal
deleted
inserted
replaced
90:37530da31268 | 91:637625a2acdb |
---|---|
1 | |
2 #include <ngx_config.h> | |
3 #include <ngx_core.h> | |
4 | |
5 | |
6 int ngx_unix_init(ngx_log_t *log) | |
7 { | |
8 struct sigaction sa; | |
9 struct rlimit rlmt; | |
10 | |
11 ngx_memzero(&sa, sizeof(struct sigaction)); | |
12 sa.sa_handler = SIG_IGN; | |
13 sigemptyset(&sa.sa_mask); | |
14 | |
15 if (sigaction(SIGPIPE, &sa, NULL) == -1) { | |
16 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | |
17 "sigaction(SIGPIPE, SIG_IGN) failed"); | |
18 return NGX_ERROR; | |
19 } | |
20 | |
21 | |
22 if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) { | |
23 ngx_log_error(NGX_LOG_ALERT, log, errno, | |
24 "getrlimit(RLIMIT_NOFILE) failed)"); | |
25 return NGX_ERROR; | |
26 } | |
27 | |
28 ngx_log_error(NGX_LOG_INFO, log, 0, | |
29 "getrlimit(RLIMIT_NOFILE): %qd:%qd", | |
30 rlmt.rlim_cur, rlmt.rlim_max); | |
31 | |
32 | |
33 #if 0 | |
34 RLIM_INFINITY | |
35 max_connections =< rlmt.rlim_cur; | |
36 #endif | |
37 | |
38 return NGX_OK; | |
39 } |