nginx-quic/src/os/unix/ngx_solaris_init.c

65 lines
1.5 KiB
C
Raw Normal View History

2003-11-13 13:16:33 -03:00
/*
* Copyright (C) 2002-2004 Igor Sysoev
*/
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,
ngx_unix_send,
2003-11-27 16:01:37 -03:00
#if (HAVE_SENDFILE)
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
};
int ngx_os_init(ngx_log_t *log)
{
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;
}
2003-11-26 12:42:18 -03:00
ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s",
2003-11-13 13:16:33 -03:00
ngx_solaris_sysname, ngx_solaris_release);
ngx_log_error(NGX_LOG_INFO, log, 0, "version: %s",
ngx_solaris_version);
return ngx_posix_init(log);
}