summaryrefslogtreecommitdiffhomepage
path: root/auto/unix (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-02-18Core: fix build without libcrypt.Piotr Sikora1-2/+2
libcrypt is no longer part of glibc, so it might not be available. Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
2023-05-06QUIC: disabled datagram fragmentation.Roman Arutyunyan1-0/+48
As per RFC 9000, Section 14: UDP datagrams MUST NOT be fragmented at the IP layer.
2021-04-05Configure: fixed --test-build-epoll on FreeBSD 13.Maxim Dounin1-23/+0
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-03-01Introduced strerrordesc_np() support.Maxim Dounin1-6/+22
The strerrordesc_np() function, introduced in glibc 2.32, provides an async-signal-safe way to obtain error messages. This makes it possible to avoid copying error messages.
2021-03-01Improved maximum errno detection.Maxim Dounin1-28/+0
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.
2019-10-17Events: available bytes calculation via ioctl(FIONREAD).Maxim Dounin1-0/+12
This makes it possible to avoid looping for a long time while working with a fast enough peer when data are added to the socket buffer faster than we are able to read and process them (ticket #1431). This is basically what we already do on FreeBSD with kqueue, where information about the number of bytes in the socket buffer is returned by the kevent() call. With other event methods rev->available is now set to -1 when the socket is ready for reading. Later in ngx_recv() and ngx_recv_chain(), if full buffer is received, real number of bytes in the socket buffer is retrieved using ioctl(FIONREAD). Reading more than this number of bytes ensures that even with edge-triggered event methods the event will be triggered again, so it is safe to stop processing of the socket and switch to other connections. Using ioctl(FIONREAD) only after reading a full buffer is an optimization. With this approach we only call ioctl(FIONREAD) when there are at least two recv()/readv() calls.
2018-03-22Configure: fixed static compilation with OpenSSL 1.1.1.Maxim Dounin1-0/+1
OpenSSL now uses pthread_atfork(), and this requires -lpthread on Linux to compile. Introduced NGX_LIBPTHREAD to add it as appropriate, similar to existing NGX_LIBDL.
2018-03-01Core: ngx_current_msec now uses monotonic time if available.Maxim Dounin1-0/+24
When clock_gettime(CLOCK_MONOTONIC) (or faster variants, _FAST on FreeBSD, and _COARSE on Linux) is available, we now use it for ngx_current_msec. This should improve handling of timers if system time changes (ticket #189).
2017-12-11Use sysconf to determine cacheline size at runtime.Debayan Ghosh1-0/+10
Determine cacheline size at runtime if supported using sysconf(_SC_LEVEL1_DCACHE_LINESIZE). In case not supported, fallback to compile time defaults.
2017-12-07Configure: fixed SO_BINDANY comment.Maxim Dounin1-1/+1
2017-12-07Configure: moved IP_BIND_ADDRESS_NO_PORT test.Maxim Dounin1-11/+11
In 2c7b488a61fb, IP_BIND_ADDRESS_NO_PORT test was accidentally placed between SO_BINDANY, IP_TRANSPARENT, and IP_BINDANY tests. Moved it after these tests.
2017-06-01Configure: disabled IP_PKTINFO feature on certain platforms.Roman Arutyunyan1-1/+4
On Cygwin and NetBSD 7.0+ struct in_pktinfo has no ipi_spec_dst field, which caused nginx compilation error. Now presence of this field is ensured by the IP_PKTINFO feature test. The problem was introduced by dbb0c854e308 (1.13.0).
2017-05-29Configure: sched_setaffinity() test moved to auto/unix.Maxim Dounin1-0/+12
The sched_setaffinity() function was introduced in DragonFly BSD 4.7, so it is no longer Linux-specific. Prodded by Sepherosa Ziehau.
2017-04-11Set UDP datagram source address (ticket #1239).Roman Arutyunyan1-0/+13
Previously, the source IP address of a response UDP datagram could differ from the original datagram destination address. This could happen if the server UDP socket is bound to a wildcard address and the network interface chosen to output the response packet has a different default address than the destination address of the original packet. For example, if two addresses from the same network are configured on an interface. Now source address is set explicitly if a response is sent for a server UDP socket bound to a wildcard address.
2017-02-01Configure: removed execute bit from auto/unix.Sergey Kandaurov1-0/+0
2016-10-04Configure: removed the --with-ipv6 option.Maxim Dounin1-14/+12
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-06-27Configure: fix build with -Werror=nonnull.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-06-27Configure: fix build with -Werror=unused-but-set-variable.Piotr Sikora1-9/+13
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-06-27Configure: style.Piotr Sikora1-2/+2
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-06-20Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.Andrei Belov1-0/+13
2015-12-18Upstream: the "transparent" parameter of proxy_bind and friends.Roman Arutyunyan1-0/+38
This parameter lets binding the proxy connection to a non-local address. Upstream will see the connection as coming from that address. When used with $remote_addr, upstream will accept the connection from real client address. Example: proxy_bind $remote_addr transparent;
2016-04-01Compatibility with FreeBSD 2.2.9.Maxim Dounin1-2/+3
Added (RTLD_NOW | RTLD_GLOBAL) to dlopen() test. There is no RTLD_GLOBAL on FreeBSD 2.2.9. Added uint32_t test, with fallback to u_int32_t, similar to uint64_t one. Added fallback to u_int32_t in in_addr_t test. With these changes it is now possible to compile nginx on FreeBSD 2.2.9 with only few minor warnings (assuming -Wno-error).
2016-01-20Stream: UDP proxy.Roman Arutyunyan1-0/+39
2016-02-18Configure: fixed static nginx build with OpenSSL (ticket #903).Ruslan Ermilov1-0/+1
Before 7142b04337d6, it was possible to build the OpenSSL library along with nginx, and link nginx statically with this library (--with-openssl=DIR --with-ld-opt=-static --with-http_ssl_module). This was broken on Linux by not adding -ldl after -lcrypto. The fix also makes it possible to link nginx statically on Linux with the system OpenSSL library, which never worked before.
2016-02-05Dynamic modules: added dlsym() to configure test.Valentin Bartenev1-1/+1
It appears that AddressSanitizer in GCC 5 intercepts dlopen() and dlclose() but not dlsym().
2016-02-04Dynamic modules: dlopen() support.Maxim Dounin1-2/+2
2015-11-17Used the pwritev() syscall for writing files where possible.Valentin Bartenev1-0/+16
It is more effective, because it doesn't require a separate lseek().
2015-06-17Configure: fix tests with multi-level relative build directory.Ruslan Ermilov1-8/+1
Based on a patch by Piotr Sikora.
2015-05-20The "reuseport" option of the "listen" directive.Maxim Dounin1-0/+10
When configured, an individual listen socket on a given address is created for each worker process. This allows to reduce in-kernel lock contention on configurations with high accept rates, resulting in better performance. As of now it works on Linux and DragonFly BSD. Note that on Linux incoming connection requests are currently tied up to a specific listen socket, and if some sockets are closed, connection requests will be reset, see https://lwn.net/Articles/542629/. With nginx, this may happen if the number of worker processes is reduced. There is no such problem on DragonFly BSD. Based on previous work by Sepherosa Ziehau and Yingqi Lu.
2015-05-20Configure: style.Maxim Dounin1-1/+1
2015-03-14Events: implemented epoll notification mechanism.Valentin Bartenev1-0/+23
2015-03-17Core: expose maximum values of time_t and ngx_int_t.Ruslan Ermilov1-0/+1
These are needed to detect overflows.
2014-05-23Events: use eventfd() instead of syscall(SYS_eventfd) if possible.Ruslan Ermilov1-6/+27
This fixes --with-file-aio support on systems that lack eventfd() syscall, notably aarch64 Linux. The syscall(SYS_eventfd) may still be necessary on systems that have eventfd() syscall in the kernel but lack it in glibc, e.g. as seen in the current CentOS 5 release.
2013-12-03Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.Mathew Rodley1-0/+12
--- auto/unix | 12 ++++++++++++ src/core/ngx_connection.c | 32 ++++++++++++++++++++++++++++++++ src/core/ngx_connection.h | 4 ++++ src/http/ngx_http.c | 4 ++++ src/http/ngx_http_core_module.c | 21 +++++++++++++++++++++ src/http/ngx_http_core_module.h | 3 +++ 6 files changed, 76 insertions(+)
2013-09-04Configure: TCP_KEEPIDLE test name simplified.Maxim Dounin1-1/+1
2013-08-05Core: guard use of AI_ADDRCONFIG.Ruslan Ermilov1-6/+2
Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support. Reported by Piotr Sikora.
2013-08-05Core: only resolve address families configured on the local system.Ruslan Ermilov1-2/+6
This is done by passing AI_ADDRCONFIG to getaddrinfo(). On Linux, setting net.ipv6.conf.all.disable_ipv6 to 1 will now be respected. On FreeBSD, AI_ADDRCONFIG filtering is currently implemented by attempting to create a datagram socket for the corresponding family, which succeeds even if the system doesn't in fact have any addresses of that family configured. That is, if the system with IPv6 support in the kernel doesn't have IPv6 addresses configured, AI_ADDRCONFIG will filter out IPv6 only inside a jail without IPv6 addresses or with IPv6 disabled.
2012-12-17Implemented IPv6 support for URLs specified using domain names.Ruslan Ermilov1-0/+14
This includes "debug_connection", upstreams, "proxy_pass", etc. (ticket #92) To preserve compatibility, "listen" specified with a domain name selects the first IPv4 address, if available. If not available, the first IPv6 address will be used (ticket #186).
2012-06-08Fixed spelling of "endianness", and called it "byte ordering" in theRuslan Ermilov1-1/+1
user visible part.
2012-03-28Configure: fixed msghdr.msg_control test on 64bit platforms.Maxim Dounin1-2/+2
Broken by r4560.
2012-03-27Fixed more gcc46 warnings in configure tests.Maxim Dounin1-18/+32
Steps to reproduce: ./configure --with-cc="gcc46" --with-cc-opt="-Wall -Werror -O2"
2012-03-21The addition of $tcpinfo_* variables has broken the build on LinuxRuslan Ermilov1-0/+5
systems with glibc versions prior to 2.7. Fixed this by checking the existence of "struct tcp_info" members during configuration.
2012-03-16Implemented $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, andRuslan Ermilov1-0/+13
$tcpinfo_rcv_space variables. Supported on Linux and FreeBSD.
2012-03-15Fixed compilation warnings in configuration C tests.Ruslan Ermilov1-4/+5
Based on a patch by Piotr Sikora.
2012-02-13Added openat()/fstatat().Andrey Belov1-0/+14
2012-02-10Added ngx_ncpu detection for most *nix platforms.Valentin Bartenev1-0/+10
This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve usage of the mutex lock optimization on multicore systems.
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-12-05Added the "so_keepalive=" parameter to the "listen" directive.Valentin Bartenev1-0/+14
The "so_keepalive" directive in mail module was deprecated. Thanks to Vsevolod Stakhov for initial work.
2011-11-21o AIX 7 defines sys_nerr in errno.h, therefore <errno.h> includedMaxim Konovalov1-4/+5
in the sys_nerr test. o When sys_nerr and _sys_nerr are missed on a particular platform and our euristic for a maximum errno detection applied always print the maximum errno number we reached instead of printing void.[*] * patch from Maxim Dounin This commit makes possible to build nginx on AIX 7.1.
2011-08-21Move SO_ACCEPTFILTER and TCP_DEFER_ACCEPT checks into configure.Maxim Dounin1-0/+23
NetBSD 5.0+ has SO_ACCEPTFILTER support merged from FreeBSD, and having accept filter check in FreeBSD-specific ngx_freebsd_config.h prevents it from being used on NetBSD. Therefore move the check into configure (and do the same for Linux-specific TCP_DEFER_ACCEPT, just to be in line).