Mercurial > hg > nginx
annotate src/os/unix/ngx_linux_init.c @ 6470:62d950bc0f15
Updated OpenSSL used for win32 builds.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 29 Mar 2016 09:54:11 +0300 |
parents | 8f038068f4bc |
children | 56fc55e32f23 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
6 |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #include <ngx_config.h> |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #include <ngx_core.h> |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
1605
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
12 u_char ngx_linux_kern_ostype[50]; |
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
13 u_char ngx_linux_kern_osrelease[50]; |
673 | 14 |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
539 | 16 static ngx_os_io_t ngx_linux_io = { |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
17 ngx_unix_recv, |
312
f5431a4bbc7d
nginx-0.0.3-2004-04-13-09:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
18 ngx_readv_chain, |
1689 | 19 ngx_udp_unix_recv, |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
391
diff
changeset
|
20 ngx_unix_send, |
6436 | 21 ngx_udp_unix_send, |
469 | 22 #if (NGX_HAVE_SENDFILE) |
196
11fbd0fc041d
nginx-0.0.1-2003-11-26-18:42:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
23 ngx_linux_sendfile_chain, |
11fbd0fc041d
nginx-0.0.1-2003-11-26-18:42:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
183
diff
changeset
|
24 NGX_IO_SENDFILE |
312
f5431a4bbc7d
nginx-0.0.3-2004-04-13-09:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
25 #else |
f5431a4bbc7d
nginx-0.0.3-2004-04-13-09:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
26 ngx_writev_chain, |
f5431a4bbc7d
nginx-0.0.3-2004-04-13-09:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
27 0 |
f5431a4bbc7d
nginx-0.0.3-2004-04-13-09:27:03 import
Igor Sysoev <igor@sysoev.ru>
parents:
196
diff
changeset
|
28 #endif |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
29 }; |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
30 |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
31 |
493 | 32 ngx_int_t |
539 | 33 ngx_os_specific_init(ngx_log_t *log) |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
34 { |
1605
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
35 struct utsname u; |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
36 |
1605
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
37 if (uname(&u) == -1) { |
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
38 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "uname() failed"); |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
39 return NGX_ERROR; |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
40 } |
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
41 |
1605
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
42 (void) ngx_cpystrn(ngx_linux_kern_ostype, (u_char *) u.sysname, |
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
43 sizeof(ngx_linux_kern_ostype)); |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 |
1605
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
45 (void) ngx_cpystrn(ngx_linux_kern_osrelease, (u_char *) u.release, |
379ee44a4456
use uname(2) instead of /proc/, this allows to run nginx in chroot
Igor Sysoev <igor@sysoev.ru>
parents:
958
diff
changeset
|
46 sizeof(ngx_linux_kern_osrelease)); |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
47 |
539 | 48 ngx_os_io = ngx_linux_io; |
49 | |
50 return NGX_OK; | |
101
2e069b6e6920
nginx-0.0.1-2003-06-04-21:28:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
51 } |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
52 |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
53 |
493 | 54 void |
539 | 55 ngx_os_specific_status(ngx_log_t *log) |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
56 { |
531 | 57 ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s", |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
58 ngx_linux_kern_ostype, ngx_linux_kern_osrelease); |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
59 } |