2003-11-14 00:16:33 +08:00
|
|
|
|
2004-09-28 16:34:51 +08:00
|
|
|
/*
|
2004-09-30 00:00:49 +08:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 16:34:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
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];
|
|
|
|
|
|
|
|
|
2005-09-07 00:09:32 +08:00
|
|
|
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,
|
2004-09-07 23:29:22 +08:00
|
|
|
ngx_unix_send,
|
2004-11-26 00:17:31 +08:00
|
|
|
#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
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-09-07 00:09:32 +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))
|
2005-09-07 00:09:32 +08:00
|
|
|
== -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))
|
2005-09-07 00:09:32 +08:00
|
|
|
== -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))
|
2005-09-07 00:09:32 +08:00
|
|
|
== -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;
|
|
|
|
}
|
|
|
|
|
2004-10-11 23:07:03 +08:00
|
|
|
|
2005-09-07 00:09:32 +08:00
|
|
|
ngx_os_io = ngx_solaris_io;
|
|
|
|
|
|
|
|
return NGX_OK;;
|
2004-10-04 04:02:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-07 00:09:32 +08:00
|
|
|
void
|
|
|
|
ngx_os_specific_status(ngx_log_t *log)
|
2004-10-04 04:02:06 +08:00
|
|
|
{
|
|
|
|
|
2005-07-25 17:41:38 +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);
|
|
|
|
|
2005-07-25 17:41:38 +08:00
|
|
|
ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
|
2003-11-14 00:16:33 +08:00
|
|
|
ngx_solaris_version);
|
|
|
|
}
|