view src/os/unix/ngx_darwin.h @ 7784:8cc5b0365ee5

Improved maximum errno detection. Previously, systems without sys_nerr (or _sys_nerr) were handled with an assumption that errors start at 0 and continuous. This is, however, not something POSIX requires, and not true on some platforms. Notably, on Linux, where sys_nerr is no longer available for newly linked binaries starting with glibc 2.32, there are gaps in error list, which used to stop us from properly detecting maximum errno. Further, on GNU/Hurd errors start at 0x40000001. With this change, maximum errno detection is moved to the runtime code, now able to ignore gaps, and also detects the first error if needed. This fixes observed "Unknown error" messages as seen on Linux with glibc 2.32 and on GNU/Hurd.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 01 Mar 2021 20:00:43 +0300
parents d620f497c50f
children
line wrap: on
line source


/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#ifndef _NGX_DARWIN_H_INCLUDED_
#define _NGX_DARWIN_H_INCLUDED_


void ngx_debug_init(void);
ngx_chain_t *ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
    off_t limit);

extern int       ngx_darwin_kern_osreldate;
extern int       ngx_darwin_hw_ncpu;
extern u_long    ngx_darwin_net_inet_tcp_sendspace;

extern ngx_uint_t  ngx_debug_malloc;


#endif /* _NGX_DARWIN_H_INCLUDED_ */