nginx/src/os/unix/ngx_solaris_init.c

75 lines
1.5 KiB
C
Raw Normal View History

2003-11-14 00:16:33 +08:00
/*
* Copyright (C) Igor Sysoev
*/
2003-11-14 00:16:33 +08:00
#include <ngx_config.h>
#include <ngx_core.h>
char ngx_solaris_sysname[20];
char ngx_solaris_release[10];
char ngx_solaris_version[50];
static ngx_os_io_t ngx_solaris_io = {
2003-11-14 00:16:33 +08:00
ngx_unix_recv,
2004-04-13 13:27:03 +08:00
ngx_readv_chain,
2007-12-04 00:46:46 +08:00
ngx_udp_unix_recv,
ngx_unix_send,
#if (NGX_HAVE_SENDFILE)
2003-11-28 03:01:37 +08:00
ngx_solaris_sendfilev_chain,
NGX_IO_SENDFILE
#else
2003-11-14 00:16:33 +08:00
ngx_writev_chain,
2003-11-26 23:42:18 +08:00
0
2003-11-28 03:01:37 +08:00
#endif
2003-11-14 00:16:33 +08:00
};
ngx_int_t
ngx_os_specific_init(ngx_log_t *log)
2003-11-14 00:16:33 +08:00
{
if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
== -1)
2003-11-14 00:16:33 +08:00
{
2004-07-15 00:01:42 +08:00
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
"sysinfo(SI_SYSNAME) failed");
2003-11-14 00:16:33 +08:00
return NGX_ERROR;
}
if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
== -1)
2003-11-14 00:16:33 +08:00
{
2004-07-15 00:01:42 +08:00
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
"sysinfo(SI_RELEASE) failed");
2003-11-14 00:16:33 +08:00
return NGX_ERROR;
}
if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
== -1)
2003-11-14 00:16:33 +08:00
{
2004-07-15 00:01:42 +08:00
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
"sysinfo(SI_SYSNAME) failed");
2003-11-14 00:16:33 +08:00
return NGX_ERROR;
}
ngx_os_io = ngx_solaris_io;
2007-10-10 04:11:03 +08:00
return NGX_OK;
2004-10-04 04:02:06 +08:00
}
void
ngx_os_specific_status(ngx_log_t *log)
2004-10-04 04:02:06 +08:00
{
ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
2003-11-14 00:16:33 +08:00
ngx_solaris_sysname, ngx_solaris_release);
ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
2003-11-14 00:16:33 +08:00
ngx_solaris_version);
}