Annotation of embedaddon/nginx/src/os/unix/ngx_solaris_init.c, revision 1.1.1.1
1.1 misho 1:
2: /*
3: * Copyright (C) Igor Sysoev
4: * Copyright (C) Nginx, Inc.
5: */
6:
7:
8: #include <ngx_config.h>
9: #include <ngx_core.h>
10:
11:
12: char ngx_solaris_sysname[20];
13: char ngx_solaris_release[10];
14: char ngx_solaris_version[50];
15:
16:
17: static ngx_os_io_t ngx_solaris_io = {
18: ngx_unix_recv,
19: ngx_readv_chain,
20: ngx_udp_unix_recv,
21: ngx_unix_send,
22: #if (NGX_HAVE_SENDFILE)
23: ngx_solaris_sendfilev_chain,
24: NGX_IO_SENDFILE
25: #else
26: ngx_writev_chain,
27: 0
28: #endif
29: };
30:
31:
32: ngx_int_t
33: ngx_os_specific_init(ngx_log_t *log)
34: {
35: if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
36: == -1)
37: {
38: ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
39: "sysinfo(SI_SYSNAME) failed");
40: return NGX_ERROR;
41: }
42:
43: if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
44: == -1)
45: {
46: ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
47: "sysinfo(SI_RELEASE) failed");
48: return NGX_ERROR;
49: }
50:
51: if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
52: == -1)
53: {
54: ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
55: "sysinfo(SI_SYSNAME) failed");
56: return NGX_ERROR;
57: }
58:
59:
60: ngx_os_io = ngx_solaris_io;
61:
62: return NGX_OK;
63: }
64:
65:
66: void
67: ngx_os_specific_status(ngx_log_t *log)
68: {
69:
70: ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
71: ngx_solaris_sysname, ngx_solaris_release);
72:
73: ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
74: ngx_solaris_version);
75: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>