Mercurial > hg > nginx
comparison src/os/unix/ngx_linux_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 | 551102312e19 |
comparison
equal
deleted
inserted
replaced
448:241dc8092a33 | 449:3b1e8c9df9ad |
---|---|
26 0 | 26 0 |
27 #endif | 27 #endif |
28 }; | 28 }; |
29 | 29 |
30 | 30 |
31 int ngx_os_init(ngx_log_t *log) | 31 ngx_int_t ngx_os_init(ngx_log_t *log) |
32 { | 32 { |
33 int name[2], len, rtsig_max; | 33 int name[2], len; |
34 | 34 |
35 name[0] = CTL_KERN; | 35 name[0] = CTL_KERN; |
36 name[1] = KERN_OSTYPE; | 36 name[1] = KERN_OSTYPE; |
37 len = sizeof(ngx_linux_kern_ostype); | 37 len = sizeof(ngx_linux_kern_ostype); |
38 if (sysctl(name, sizeof(name), ngx_linux_kern_ostype, &len, NULL, 0) | 38 if (sysctl(name, sizeof(name), ngx_linux_kern_ostype, &len, NULL, 0) |
50 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | 50 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, |
51 "sysctl(KERN_OSRELEASE) failed"); | 51 "sysctl(KERN_OSRELEASE) failed"); |
52 return NGX_ERROR; | 52 return NGX_ERROR; |
53 } | 53 } |
54 | 54 |
55 ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s", | |
56 ngx_linux_kern_ostype, ngx_linux_kern_osrelease); | |
57 | |
58 | 55 |
59 name[0] = CTL_KERN; | 56 name[0] = CTL_KERN; |
60 name[1] = KERN_RTSIGMAX; | 57 name[1] = KERN_RTSIGMAX; |
61 len = sizeof(rtsig_max); | 58 len = sizeof(rtsig_max); |
62 if (sysctl(name, sizeof(name), &rtsig_max, &len, NULL, 0) == -1) { | 59 if (sysctl(name, sizeof(name), &ngx_linux_rtsig_max, &len, NULL, 0) == -1) { |
63 ngx_log_error(NGX_LOG_INFO, log, ngx_errno, | 60 ngx_log_error(NGX_LOG_INFO, log, ngx_errno, |
64 "sysctl(KERN_RTSIGMAX) failed"); | 61 "sysctl(KERN_RTSIGMAX) failed"); |
65 } else { | 62 ngx_linux_rtsig_max = 0; |
66 ngx_linux_rtsig_max = 1; | 63 |
67 } | 64 } |
68 | 65 |
69 | 66 |
70 return ngx_posix_init(log); | 67 return ngx_posix_init(log); |
71 } | 68 } |
69 | |
70 | |
71 void ngx_os_status(ngx_log_t *log) | |
72 { | |
73 ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s", | |
74 ngx_linux_kern_ostype, ngx_linux_kern_osrelease); | |
75 | |
76 ngx_log_error(NGX_LOG_INFO, log, 0, "sysctl(KERN_RTSIGMAX): %d", | |
77 ngx_linux_rtsig_max); | |
78 | |
79 ngx_posix_status(log); | |
80 } |