Commit Graph

124 Commits

Author SHA1 Message Date
Maxim Dounin
2c84f7af2c Configure: removed the --with-ipv6 option.
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-10-04 16:38:14 +03:00
Valentin Bartenev
5c2dd3913a Events: support for EPOLLEXCLUSIVE.
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-07-15 15:18:57 +03:00
Piotr Sikora
f8c6a0800c Configure: fix build with -Werror=unused-but-set-variable.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-06-27 15:00:03 -07:00
Maxim Dounin
97f59dda09 Dynamic modules.
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.
2016-02-04 20:25:29 +03:00
Maxim Dounin
226647e397 Configure: GNU Hurd properly recognized.
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-05-25 17:58:13 +03:00
Ruslan Ermilov
33b8e5bc06 Removed the obsolete rtsig module. 2015-04-23 14:17:40 +03:00
Ruslan Ermilov
c1882d9f3f Removed the obsolete aio module. 2015-04-22 18:57:32 +03:00
Ruslan Ermilov
08e05a4042 Configure: removed obsolete threads bits. 2015-03-13 19:08:27 +03:00
Ruslan Ermilov
d81db90455 Configure: removed redundant auto/have call.
The auto/feature call above is enough to set NGX_HAVE_SENDFILE.
2015-03-13 16:43:01 +03:00
Sergey Kandaurov
7f3f7fec77 Configure: typo fixed. 2015-02-11 20:18:55 +03:00
Valentin Bartenev
0a3d458805 Unbreak building on FreeBSD without file AIO.
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.
2015-02-11 20:00:07 +03:00
Valentin Bartenev
182a05b9d5 Events: support for EPOLLRDHUP (ticket #320).
Since Linux 2.6.17, epoll is able to report about peer half-closed connection
using special EPOLLRDHUP flag on a read event.
2013-07-12 14:51:07 +04:00
Maxim Dounin
48d96ced6f Win32: MinGW GCC compatibility.
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-04 20:48:28 +04:00
Valentin Bartenev
7b37384140 Disable symlinks: use O_PATH to open path components.
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-09-02 08:07:59 +04:00
Ruslan Ermilov
c4a044cc50 Configure: fixed test of OS X atomic(3). 2013-05-23 10:23:21 +04:00
Maxim Dounin
97f7bf25c9 Fixed "sendmsg() failed" alerts on HP-UX.
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-18 14:11:29 +00:00
Maxim Dounin
c45bd10b1c Changed default alignment to 16.
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-06-18 14:09:54 +00:00
Maxim Dounin
a3bdd737e5 Fixed more gcc46 warnings in configure tests.
Steps to reproduce:

./configure --with-cc="gcc46" --with-cc-opt="-Wall -Werror -O2"
2012-03-27 16:44:52 +00:00
Ruslan Ermilov
fbd32d4d19 worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support. 2012-03-21 13:58:51 +00:00
Ruslan Ermilov
4489fa8893 Fixed compilation warnings in configuration C tests.
Based on a patch by Piotr Sikora.
2012-03-15 20:39:38 +00:00
Maxim Konovalov
f8d59e33f3 Copyright updated. 2012-01-18 15:07:43 +00:00
Maxim Dounin
1a664a80a9 Configure: catch up with new Linux version numbering (ticket #5).
Catch up with new Linux version numbering scheme as announced at [1] and
suppress unrecognized versions to actually use default 0.

[1] https://lkml.org/lkml/2011/5/29/204
2011-08-13 15:15:50 +00:00
Igor Sysoev
e9041dd12c concatenate auto/os/features and auto/unix 2011-05-31 08:25:10 +00:00
Igor Sysoev
e2c8ad7122 use POSIX semaphores in shmtx instead of sched_yield()
number of spinlock spins are increased twice
2011-05-10 11:39:13 +00:00
Igor Sysoev
40747ad861 Linux accept4() support 2010-11-25 10:15:04 +00:00
Igor Sysoev
0bd7a7d894 listen setfib=X 2010-07-05 13:49:16 +00:00
Igor Sysoev
c8832ccc1d posix_fadvise64() had been implemented in Linux 2.5.60 2009-11-03 16:29:47 +00:00
Igor Sysoev
3266171fd4 read_ahead 2009-09-30 13:21:52 +00:00
Igor Sysoev
908194eddd fail if no file aio was found 2009-09-10 12:08:30 +00:00
Igor Sysoev
bfff03406d aio sendfile 2009-08-30 09:52:39 +00:00
Igor Sysoev
a962506498 FreeBSD and Linux AIO support 2009-08-28 08:12:35 +00:00
Igor Sysoev
ba1ff6e946 fix Linux "uname -r" version matching 2009-08-24 11:04:46 +00:00
Igor Sysoev
9af0c95f64 librt must be tested before creating Makefile
the bug has been introduced in r2817
2009-06-03 04:53:01 +00:00
Igor Sysoev
7741b350e9 test libdl before OpenSSL configuration
the bug has been introduced in r2818 and broke
*) SSL modules linking on Solaris 9 and lower,
*) and linking with OpenSSL built from sources on Linux
2009-05-24 14:19:16 +00:00
Igor Sysoev
ec43d91a58 backout -r2827 and add correct fix 2009-05-10 19:49:14 +00:00
Igor Sysoev
acca7dbf5d add MSYS support 2009-05-10 18:35:39 +00:00
Igor Sysoev
225d47185a Solaris 10 has sched_yield() in libc 2009-05-08 09:36:16 +00:00
Igor Sysoev
dbc205ab5a IPv6 for Win32 2009-05-07 13:05:04 +00:00
Igor Sysoev
6ce6fcd12d divide select module into two modules: Unix and Win32 ones 2009-05-06 14:53:54 +00:00
Igor Sysoev
1290cf83af fix GNU strerror_r() detection, the bug has been inroduced in r2600 2009-04-24 09:38:48 +00:00
Igor Sysoev
890467c1c4 *) move advapi32.lib to core libs since it's required for Registry and Event Log
*) delete shell32.lib since we do not use tray icon anymore
2009-04-21 14:31:40 +00:00
Igor Sysoev
c919d3178a autoconfigure crypt_r(): uclibc has no crypt_r() 2009-04-02 13:46:39 +00:00
Igor Sysoev
723f71ddfe fix FreeBSD before 7 building, broken in r2616 2009-03-30 12:33:33 +00:00
Igor Sysoev
1be7419d10 ngx_fs_bsize() 2009-03-30 07:43:06 +00:00
Igor Sysoev
0f825e6440 fix Linux sendfile32() test broken in 0.3.36 2009-03-23 20:30:25 +00:00
Igor Sysoev
92d543deaa style fix 2009-03-23 20:26:33 +00:00
Igor Sysoev
fae2c00d02 disable directio for unaligned reads in Linux 2008-09-12 13:50:12 +00:00
Igor Sysoev
b83f893c75 Solaris directio() 2008-08-04 15:32:10 +00:00
Igor Sysoev
385af28642 directio 2008-07-30 12:34:04 +00:00
Igor Sysoev
7494490978 *) move Darwin support to separate files
*) Darwin sendfile() support
2008-07-30 12:18:07 +00:00