Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.15.11 ]​[ nginx-1.14.2 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #include <ngx_config.h>
0009 #include <ngx_core.h>
0010 
0011 
0012 char ngx_solaris_sysname[20];
0013 char ngx_solaris_release[10];
0014 char ngx_solaris_version[50];
0015 
0016 
0017 static ngx_os_io_t ngx_solaris_io = {
0018     ngx_unix_recv,
0019     ngx_readv_chain,
0020     ngx_udp_unix_recv,
0021     ngx_unix_send,
0022     ngx_udp_unix_send,
0023     ngx_udp_unix_sendmsg_chain,
0024 #if (NGX_HAVE_SENDFILE)
0025     ngx_solaris_sendfilev_chain,
0026     NGX_IO_SENDFILE
0027 #else
0028     ngx_writev_chain,
0029     0
0030 #endif
0031 };
0032 
0033 
0034 ngx_int_t
0035 ngx_os_specific_init(ngx_log_t *log)
0036 {
0037     if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
0038         == -1)
0039     {
0040         ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
0041                       "sysinfo(SI_SYSNAME) failed");
0042         return NGX_ERROR;
0043     }
0044 
0045     if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
0046         == -1)
0047     {
0048         ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
0049                       "sysinfo(SI_RELEASE) failed");
0050         return NGX_ERROR;
0051     }
0052 
0053     if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
0054         == -1)
0055     {
0056         ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
0057                       "sysinfo(SI_SYSNAME) failed");
0058         return NGX_ERROR;
0059     }
0060 
0061 
0062     ngx_os_io = ngx_solaris_io;
0063 
0064     return NGX_OK;
0065 }
0066 
0067 
0068 void
0069 ngx_os_specific_status(ngx_log_t *log)
0070 {
0071 
0072     ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
0073                   ngx_solaris_sysname, ngx_solaris_release);
0074 
0075     ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
0076                   ngx_solaris_version);
0077 }