summaryrefslogtreecommitdiffhomepage
path: root/auto/os (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-02-26Configure: allow cross-compiling to Windows using Clang.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
2024-03-27Configure: set cache line size for more architectures.Sergey Kandaurov1-0/+15
Based on a patch by Piotr Sikora.
2024-02-26Configure: fixed Linux crypt_r() test to add libcrypt.Sergey Kandaurov1-0/+4
Previously, the resulting binary was successfully linked because libcrypt was added in a separate test for crypt(). Patch by Piotr Sikora.
2023-03-29Merged with the default branch.Sergey Kandaurov1-1/+0
2023-01-24QUIC: improved SO_COOKIE configure test.Maxim Dounin1-1/+1
In nginx source code the inttypes.h include, if available, is used to define standard integer types. Changed the SO_COOKIE configure test to follow this.
2023-01-23Configure: removed unneeded header from UDP_SEGMENT test.Maxim Dounin1-1/+0
2022-06-22Merged with the default branch.Sergey Kandaurov1-1/+1
2022-04-29Configure: recognize arm64 machine name as a synonym for aarch64.Sergey Kandaurov1-1/+1
In particular, this sets a reasonable cacheline size on FreeBSD and macOS, which prefer to use this name and both lack _SC_LEVEL1_DCACHE_LINESIZE.
2022-02-14Merged with the default branch.Sergey Kandaurov1-3/+3
2022-01-26Core: added autotest for UDP segmentation offloading.Vladimir Homutov1-0/+16
2021-12-29Merged with the default branch.Sergey Kandaurov1-5/+3
2021-12-27Simplified sendfile(SF_NODISKIO) usage.Maxim Dounin1-5/+3
Starting with FreeBSD 11, there is no need to use AIO operations to preload data into cache for sendfile(SF_NODISKIO) to work. Instead, sendfile() handles non-blocking loading data from disk by itself. It still can, however, return EBUSY if a page is already being loaded (for example, by a different process). If this happens, we now post an event for the next event loop iteration, so sendfile() is retried "after a short period", as manpage recommends. The limit of the number of EBUSY tolerated without any progress is preserved, but now it does not result in an alert, since on an idle system event loop iteration might be very short and EBUSY can happen many times in a row. Instead, SF_NODISKIO is simply disabled for one call once the limit is reached. With this change, sendfile(SF_NODISKIO) is now used automatically as long as sendfile() is enabled, and no longer requires "aio on;".
2021-12-09QUIC: removed configure time test for BPF sockhash.Ruslan Ermilov1-14/+1
The test verifies kernel version on a build machine, but actually used kernel may be different.
2021-12-09QUIC: configure cleanup.Ruslan Ermilov1-41/+29
Renamed and removed some macros.
2021-07-15QUIC: added support for segmentation offloading.Vladimir Homutov1-0/+21
To improve output performance, UDP segmentation offloading is used if available. If there is a significant amount of data in an output queue and path is verified, QUIC packets are not sent one-by-one, but instead are collected in a buffer, which is then passed to kernel in a single sendmsg call, using UDP GSO. Such method greatly decreases number of system calls and thus system load.
2021-04-05Configure: fixed --test-build-epoll on FreeBSD 13.Maxim Dounin1-0/+25
In FreeBSD 13, eventfd(2) was added, and this breaks build with --test-build-epoll and without --with-file-aio. Fix is to move eventfd(2) detection to auto/os/linux, as it is used only on Linux as a notification mechanism for epoll().
2021-04-16Merged with the default branch.Sergey Kandaurov1-0/+25
2020-12-25QUIC: ngx_quic_bpf module.Vladimir Homutov1-0/+38
The quic kernel bpf helper inspects packet payload for DCID, extracts key and routes the packet into socket matching the key. Due to reuseport feature, each worker owns a personal socket, which is identified by the same key, used to create DCID. BPF objects are locked in RAM and are subject to RLIMIT_MEMLOCK. The "ulimit -l" command may be used to setup proper limits, if maps cannot be created with EPERM or updated with ETOOLONG.
2020-12-15Core: added interface to linux bpf() system call.Vladimir Homutov1-0/+26
It contains wrappers for operations with BPF maps and for loading BPF programs.
2019-01-24Win32: enabled both select and poll on Windows by default.Maxim Dounin1-7/+1
Since we now have both select and poll on Windows, it is enough to do not set EVENT_FOUND, auto/modules will enable both automatically.
2019-01-24Win32: added WSAPoll() support.Maxim Dounin1-0/+1
WSAPoll() is only available with Windows Vista and newer (and only available during compilation if _WIN32_WINNT >= 0x0600). To make sure the code works with Windows XP, we do not redefine _WIN32_WINNT, but instead load WSAPoll() dynamically if it is not available during compilation. Also, sockets are not guaranteed to be small integers on Windows. So an index array is used instead of NGX_USE_FD_EVENT to map events to connections.
2019-01-24Win32: properly enabled select on Windows.Maxim Dounin1-0/+1
Previously, select was compiled in by default, but the NGX_HAVE_SELECT macro was not set, resulting in iocp being used by default unless the "--with-select_module" configure option was explicitly specified. Since the iocp module is not finished and does not work properly, this effectively meant that the "--with-select_module" option was mandatory. With the change NGX_HAVE_SELECT is properly set, making "--with-select_module" optional. Accordingly, it is removed from misc/GNUmakefile win32 target.
2018-07-24Configure: fixed compiler warnings with "-Wall -Wextra".Sergey Kandaurov1-0/+2
2017-12-19Fixed capabilities version.Roman Arutyunyan1-1/+1
Previously, capset(2) was called with the 64-bit capabilities version _LINUX_CAPABILITY_VERSION_3. With this version Linux kernel expected two copies of struct __user_cap_data_struct, while only one was submitted. As a result, random stack memory was accessed and random capabilities were requested by the worker. This sometimes caused capset() errors. Now the 32-bit version _LINUX_CAPABILITY_VERSION_1 is used instead. This is OK since CAP_NET_RAW is a 32-bit capability (CAP_NET_RAW = 13).
2017-12-18Improved the capabilities feature detection.Roman Arutyunyan1-2/+3
Previously included file sys/capability.h mentioned in capset(2) man page, belongs to the libcap-dev package, which may not be installed on some Linux systems when compiling nginx. This prevented the capabilities feature from being detected and compiled on that systems. Now linux/capability.h system header is included instead. Since capset() declaration is located in sys/capability.h, now capset() syscall is defined explicitly in code using the SYS_capset constant, similarly to other Linux-specific features in nginx.
2017-12-13Retain CAP_NET_RAW capability for transparent proxying.Roman Arutyunyan1-0/+31
The capability is retained automatically in unprivileged worker processes after changing UID if transparent proxying is enabled at least once in nginx configuration. The feature is only available in Linux.
2017-12-11Configure: set default cacheline size to 64 for aarch64 platforms.Debayan Ghosh1-0/+5
2017-06-06Configure: use .exe for binaries for all win32 compilers.Orgad Shaneh1-0/+1
2017-06-02Configure: enabled rpath for NetBSD.Sergey Kandaurov1-0/+8
2017-05-29Configure: sched_setaffinity() test moved to auto/unix.Maxim Dounin1-14/+0
The sched_setaffinity() function was introduced in DragonFly BSD 4.7, so it is no longer Linux-specific. Prodded by Sepherosa Ziehau.
2017-04-17Enabled IPV6_RECVPKTINFO / IPV6_PKTINFO on macOS.Sergey Kandaurov1-1/+3
This change allows setting the destination IPv6 address of a UDP datagram received on a wildcard socket.
2016-10-04Configure: removed the --with-ipv6 option.Maxim Dounin1-3/+1
IPv6 now compiled-in automatically if support is found. If there is a need to disable it for some reason, --with-cc-opt="-DNGX_HAVE_INET6=0" can be used for this.
2016-07-15Events: support for EPOLLEXCLUSIVE.Valentin Bartenev1-0/+16
This flag appeared in Linux 4.5 and is useful for avoiding thundering herd problem. The current Linux kernel implementation walks the list of exclusive waiters, and queues an event to each epfd, until it finds the first waiter that has threads blocked on it via epoll_wait().
2016-06-27Configure: fix build with -Werror=unused-but-set-variable.Piotr Sikora3-3/+4
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-02-04Dynamic modules.Maxim Dounin2-0/+8
The auto/module script is extended to understand ngx_module_link=DYNAMIC. When set, it links the module as a shared object rather than statically into nginx binary. The module can later be loaded using the "load_module" directive. New auto/module parameter ngx_module_order allows to define module loading order in complex cases. By default the order is set based on ngx_module_type. 3rd party modules can be compiled dynamically using the --add-dynamic-module configure option, which will preset ngx_module_link to "DYNAMIC" before calling the module config script. Win32 support is rudimentary, and only works when using MinGW gcc (which is able to handle exports/imports automatically). In collaboration with Ruslan Ermilov.
2015-05-25Configure: GNU Hurd properly recognized.Maxim Dounin1-0/+9
With this change it's no longer needed to pass -D_GNU_SOURCE manually, and -D_FILE_OFFSET_BITS=64 is set to use 64-bit off_t. Note that nginx currently fails to work properly with master process enabled on GNU Hurd, as fcntl(F_SETOWN) returns EOPNOTSUPP for sockets as of GNU Hurd 0.6. Additionally, our strerror() preloading doesn't work well with GNU Hurd, as it uses large numbers for most errors.
2015-04-23Removed the obsolete rtsig module.Ruslan Ermilov1-12/+0
2015-04-22Removed the obsolete aio module.Ruslan Ermilov2-21/+0
2015-03-13Configure: removed obsolete threads bits.Ruslan Ermilov1-19/+0
2015-03-13Configure: removed redundant auto/have call.Ruslan Ermilov1-1/+0
The auto/feature call above is enough to set NGX_HAVE_SENDFILE.
2015-02-11Configure: typo fixed.Sergey Kandaurov1-1/+1
2015-02-11Unbreak building on FreeBSD without file AIO.Valentin Bartenev1-3/+5
It appeared that the NGX_HAVE_AIO_SENDFILE macro was defined regardless of the "--with-file-aio" configure option and the NGX_HAVE_FILE_AIO macro. Now they are related. Additionally, fixed one macro.
2013-07-12Events: support for EPOLLRDHUP (ticket #320).Valentin Bartenev1-0/+16
Since Linux 2.6.17, epoll is able to report about peer half-closed connection using special EPOLLRDHUP flag on a read event.
2013-09-04Win32: MinGW GCC compatibility.Maxim Dounin1-1/+12
Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
2013-09-02Disable symlinks: use O_PATH to open path components.Valentin Bartenev1-0/+16
It was introduced in Linux 2.6.39, glibc 2.14 and allows to obtain file descriptors without actually opening files. Thus made it possible to traverse path with openat() syscalls without the need to have read permissions for path components. It is effectively emulates O_SEARCH which is missing on Linux. O_PATH is used in combination with O_RDONLY. The last one is ignored if O_PATH is used, but it allows nginx to not fail when it was built on modern system (i.e. glibc 2.14+) and run with a kernel older than 2.6.39. Then O_PATH is unknown to the kernel and ignored, while O_RDONLY is used. Sadly, fstat() is not working with O_PATH descriptors till Linux 3.6. As a workaround we fallback to fstatat() with the AT_EMPTY_PATH flag that was introduced at the same time as O_PATH.
2013-05-23Configure: fixed test of OS X atomic(3).Ruslan Ermilov1-1/+1
2012-06-18Fixed "sendmsg() failed" alerts on HP-UX.Maxim Dounin1-0/+1
HP-UX needs _HPUX_ALT_XOPEN_SOCKET_API to be defined to be able to use various POSIX versions of networking functions. Notably sendmsg() resulted in "sendmsg() failed (9: Bad file number)" alerts without it. See xopen_networking(7) for more details.
2012-06-18Changed default alignment to 16.Maxim Dounin1-0/+1
This fixes alignment problems observerd on ARMs, and likely also needed for MIPSes. Unless we know alignment is not required just assume we need 16, which appears to be safe default for all architectures. See here for details: http://mailman.nginx.org/pipermail/nginx/2012-June/034139.html
2012-03-27Fixed more gcc46 warnings in configure tests.Maxim Dounin1-1/+2
Steps to reproduce: ./configure --with-cc="gcc46" --with-cc-opt="-Wall -Werror -O2"
2012-03-21worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.Ruslan Ermilov2-2/+11