2003-11-13 13:16:33 -03:00
|
|
|
|
2004-09-28 04:34:51 -04:00
|
|
|
/*
|
2004-09-29 12:00:49 -04:00
|
|
|
* Copyright (C) Igor Sysoev
|
2004-09-28 04:34:51 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-11-13 13:16:33 -03:00
|
|
|
#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,
|
2004-04-13 01:27:03 -04:00
|
|
|
ngx_readv_chain,
|
2004-09-07 11:29:22 -04:00
|
|
|
ngx_unix_send,
|
2004-11-25 13:17:31 -03:00
|
|
|
#if (NGX_HAVE_SENDFILE)
|
2003-11-27 16:01:37 -03:00
|
|
|
ngx_solaris_sendfilev_chain,
|
|
|
|
NGX_IO_SENDFILE
|
|
|
|
#else
|
2003-11-13 13:16:33 -03:00
|
|
|
ngx_writev_chain,
|
2003-11-26 12:42:18 -03:00
|
|
|
0
|
2003-11-27 16:01:37 -03:00
|
|
|
#endif
|
2003-11-13 13:16:33 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-10-03 16:02:06 -04:00
|
|
|
ngx_int_t ngx_os_init(ngx_log_t *log)
|
2003-11-13 13:16:33 -03:00
|
|
|
{
|
|
|
|
if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
|
|
|
|
== -1)
|
|
|
|
{
|
2004-07-14 12:01:42 -04:00
|
|
|
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
|
|
|
|
"sysinfo(SI_SYSNAME) failed");
|
2003-11-13 13:16:33 -03:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
|
|
|
|
== -1)
|
|
|
|
{
|
2004-07-14 12:01:42 -04:00
|
|
|
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
|
|
|
|
"sysinfo(SI_RELEASE) failed");
|
2003-11-13 13:16:33 -03:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
|
|
|
|
== -1)
|
|
|
|
{
|
2004-07-14 12:01:42 -04:00
|
|
|
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
|
|
|
|
"sysinfo(SI_SYSNAME) failed");
|
2003-11-13 13:16:33 -03:00
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
|
2004-10-03 16:02:06 -04:00
|
|
|
return ngx_posix_init(log);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ngx_os_status(ngx_log_t *log)
|
|
|
|
{
|
|
|
|
|
2005-07-25 05:41:38 -04:00
|
|
|
ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
|
2003-11-13 13:16:33 -03:00
|
|
|
ngx_solaris_sysname, ngx_solaris_release);
|
|
|
|
|
2005-07-25 05:41:38 -04:00
|
|
|
ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
|
2003-11-13 13:16:33 -03:00
|
|
|
ngx_solaris_version);
|
|
|
|
|
2004-10-03 16:02:06 -04:00
|
|
|
ngx_posix_status(log);
|
2003-11-13 13:16:33 -03:00
|
|
|
}
|