nginx 0.5.34
[nginx-catap.git] / src / os / unix / ngx_solaris_init.c
bloba255059745a476fa7d553dc801071c54b1096024
2 /*
3 * Copyright (C) Igor Sysoev
4 */
7 #include <ngx_config.h>
8 #include <ngx_core.h>
11 char ngx_solaris_sysname[20];
12 char ngx_solaris_release[10];
13 char ngx_solaris_version[50];
16 static ngx_os_io_t ngx_solaris_io = {
17 ngx_unix_recv,
18 ngx_readv_chain,
19 ngx_unix_send,
20 #if (NGX_HAVE_SENDFILE)
21 ngx_solaris_sendfilev_chain,
22 NGX_IO_SENDFILE
23 #else
24 ngx_writev_chain,
26 #endif
30 ngx_int_t
31 ngx_os_specific_init(ngx_log_t *log)
33 if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
34 == -1)
36 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
37 "sysinfo(SI_SYSNAME) failed");
38 return NGX_ERROR;
41 if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
42 == -1)
44 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
45 "sysinfo(SI_RELEASE) failed");
46 return NGX_ERROR;
49 if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
50 == -1)
52 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
53 "sysinfo(SI_SYSNAME) failed");
54 return NGX_ERROR;
58 ngx_os_io = ngx_solaris_io;
60 return NGX_OK;
64 void
65 ngx_os_specific_status(ngx_log_t *log)
68 ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
69 ngx_solaris_sysname, ngx_solaris_release);
71 ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
72 ngx_solaris_version);