3 * Copyright (C) Igor Sysoev
7 #include <ngx_config.h>
11 u_char ngx_linux_kern_ostype[50];
12 u_char ngx_linux_kern_osrelease[50];
14 int ngx_linux_rtsig_max;
17 static ngx_os_io_t ngx_linux_io = {
22 #if (NGX_HAVE_SENDFILE)
23 ngx_linux_sendfile_chain,
33 ngx_os_specific_init(ngx_log_t *log)
37 if (uname(&u) == -1) {
38 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "uname() failed");
42 (void) ngx_cpystrn(ngx_linux_kern_ostype, (u_char *) u.sysname,
43 sizeof(ngx_linux_kern_ostype));
45 (void) ngx_cpystrn(ngx_linux_kern_osrelease, (u_char *) u.release,
46 sizeof(ngx_linux_kern_osrelease));
55 name[1] = KERN_RTSIGMAX;
56 len = sizeof(ngx_linux_rtsig_max);
58 if (sysctl(name, 2, &ngx_linux_rtsig_max, &len, NULL, 0) == -1) {
61 if (err != NGX_ENOTDIR && err != NGX_ENOSYS) {
62 ngx_log_error(NGX_LOG_ALERT, log, err,
63 "sysctl(KERN_RTSIGMAX) failed");
68 ngx_linux_rtsig_max = 0;
74 ngx_os_io = ngx_linux_io;
81 ngx_os_specific_status(ngx_log_t *log)
83 ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
84 ngx_linux_kern_ostype, ngx_linux_kern_osrelease);
87 ngx_log_error(NGX_LOG_NOTICE, log, 0, "sysctl(KERN_RTSIGMAX): %d",