aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_solaris_init.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-13 16:16:33 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-13 16:16:33 +0000
commit45890ea8c13a561fe3fd66bf639ad429f3c18846 (patch)
tree72b5d6ceedcd3152d68d579989a99ddf0de84db5 /src/os/unix/ngx_solaris_init.c
parent562e53ea7d2ec904abba1cf9a9766fe3a91574e8 (diff)
downloadnginx-45890ea8c13a561fe3fd66bf639ad429f3c18846.tar.gz
nginx-45890ea8c13a561fe3fd66bf639ad429f3c18846.zip
nginx-0.0.1-2003-11-13-19:16:33 import
Diffstat (limited to 'src/os/unix/ngx_solaris_init.c')
-rw-r--r--src/os/unix/ngx_solaris_init.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/os/unix/ngx_solaris_init.c b/src/os/unix/ngx_solaris_init.c
new file mode 100644
index 000000000..c593ed936
--- /dev/null
+++ b/src/os/unix/ngx_solaris_init.c
@@ -0,0 +1,51 @@
+
+#include <ngx_config.h>
+#include <ngx_core.h>
+
+
+char ngx_solaris_sysname[20];
+char ngx_solaris_release[10];
+char ngx_solaris_version[50];
+
+
+ngx_os_io_t ngx_os_io = {
+ ngx_unix_recv,
+ NULL,
+ NULL,
+ ngx_writev_chain,
+ NGX_HAVE_ZEROCOPY
+};
+
+
+int ngx_os_init(ngx_log_t *log)
+{
+ if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
+ == -1)
+ {
+ ngx_log_error(NGX_LOG_ALERT, log, errno, "sysinfo(SI_SYSNAME) failed");
+ return NGX_ERROR;
+ }
+
+ if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
+ == -1)
+ {
+ ngx_log_error(NGX_LOG_ALERT, log, errno, "sysinfo(SI_RELEASE) failed");
+ return NGX_ERROR;
+ }
+
+ if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
+ == -1)
+ {
+ ngx_log_error(NGX_LOG_ALERT, log, errno, "sysinfo(SI_SYSNAME) failed");
+ return NGX_ERROR;
+ }
+
+ ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s"
+ ngx_solaris_sysname, ngx_solaris_release);
+
+ ngx_log_error(NGX_LOG_INFO, log, 0, "version: %s",
+ ngx_solaris_version);
+
+
+ return ngx_posix_init(log);
+}