aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-11-25 16:17:31 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-11-25 16:17:31 +0000
commitf69060481edeaca075669b50e34ca8ec821c2401 (patch)
tree6fa6907cc2fdfe0ac6bcdf7f63e76a7f8b41f33f /src/os/unix
parent865a7de474a13c5f1202f97fac31565f33a5e1a1 (diff)
downloadnginx-release-0.1.9.tar.gz
nginx-release-0.1.9.zip
nginx-0.1.9-RELEASE importrelease-0.1.9
*) Bugfix: the proxied request was sent without arguments if the request contains "//", "/./", "/../" or "%XX". *) Bugfix: the large compressed responses may be transferred not completely. *) Bugfix: the files bigger than 2G was not transferred on Linux that does not support sendfile64(). *) Bugfix: while the build configuration on Linux the --with-poll_module parameter was required; the bug had appeared in 0.1.8.
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_aio_read.c4
-rw-r--r--src/os/unix/ngx_aio_write.c4
-rw-r--r--src/os/unix/ngx_alloc.c4
-rw-r--r--src/os/unix/ngx_alloc.h2
-rw-r--r--src/os/unix/ngx_channel.c8
-rw-r--r--src/os/unix/ngx_errno.c4
-rw-r--r--src/os/unix/ngx_errno.h2
-rw-r--r--src/os/unix/ngx_files.c4
-rw-r--r--src/os/unix/ngx_freebsd_config.h14
-rw-r--r--src/os/unix/ngx_freebsd_init.c6
-rw-r--r--src/os/unix/ngx_freebsd_rfork_thread.c10
-rw-r--r--src/os/unix/ngx_freebsd_sendfile_chain.c2
-rw-r--r--src/os/unix/ngx_linux_config.h20
-rw-r--r--src/os/unix/ngx_linux_init.c2
-rw-r--r--src/os/unix/ngx_linux_sendfile_chain.c2
-rw-r--r--src/os/unix/ngx_os.h12
-rw-r--r--src/os/unix/ngx_posix_config.h6
-rw-r--r--src/os/unix/ngx_posix_init.c2
-rw-r--r--src/os/unix/ngx_process_cycle.c13
-rw-r--r--src/os/unix/ngx_readv_chain.c6
-rw-r--r--src/os/unix/ngx_recv.c6
-rw-r--r--src/os/unix/ngx_send.c2
-rw-r--r--src/os/unix/ngx_shared.c6
-rw-r--r--src/os/unix/ngx_socket.c2
-rw-r--r--src/os/unix/ngx_socket.h2
-rw-r--r--src/os/unix/ngx_solaris_config.h16
-rw-r--r--src/os/unix/ngx_solaris_init.c2
-rw-r--r--src/os/unix/ngx_thread.h1
-rw-r--r--src/os/unix/ngx_time.c2
-rw-r--r--src/os/unix/ngx_time.h2
-rw-r--r--src/os/unix/ngx_writev_chain.c2
31 files changed, 84 insertions, 86 deletions
diff --git a/src/os/unix/ngx_aio_read.c b/src/os/unix/ngx_aio_read.c
index d01105412..2a66eb83c 100644
--- a/src/os/unix/ngx_aio_read.c
+++ b/src/os/unix/ngx_aio_read.c
@@ -9,7 +9,7 @@
#include <ngx_event.h>
#include <ngx_aio.h>
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
#include <ngx_kqueue_module.h>
#endif
@@ -46,7 +46,7 @@ ssize_t ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size)
rev->aiocb.aio_buf = buf;
rev->aiocb.aio_nbytes = size;
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
rev->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
rev->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
rev->aiocb.aio_sigevent.sigev_value.sigval_ptr = rev;
diff --git a/src/os/unix/ngx_aio_write.c b/src/os/unix/ngx_aio_write.c
index f102ba338..1d8c1aacd 100644
--- a/src/os/unix/ngx_aio_write.c
+++ b/src/os/unix/ngx_aio_write.c
@@ -9,7 +9,7 @@
#include <ngx_event.h>
#include <ngx_aio.h>
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
#include <ngx_kqueue_module.h>
#endif
@@ -43,7 +43,7 @@ ssize_t ngx_aio_write(ngx_connection_t *c, u_char *buf, size_t size)
wev->aiocb.aio_buf = buf;
wev->aiocb.aio_nbytes = size;
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
wev->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
wev->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
wev->aiocb.aio_sigevent.sigev_value.sigval_ptr = wev;
diff --git a/src/os/unix/ngx_alloc.c b/src/os/unix/ngx_alloc.c
index 7ec4f87c3..258a10fa9 100644
--- a/src/os/unix/ngx_alloc.c
+++ b/src/os/unix/ngx_alloc.c
@@ -40,7 +40,7 @@ void *ngx_calloc(size_t size, ngx_log_t *log)
}
-#if (HAVE_POSIX_MEMALIGN)
+#if (NGX_HAVE_POSIX_MEMALIGN)
void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
{
@@ -58,7 +58,7 @@ void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
return p;
}
-#elif (HAVE_MEMALIGN)
+#elif (NGX_HAVE_MEMALIGN)
void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
{
diff --git a/src/os/unix/ngx_alloc.h b/src/os/unix/ngx_alloc.h
index 0084c2c54..66562a191 100644
--- a/src/os/unix/ngx_alloc.h
+++ b/src/os/unix/ngx_alloc.h
@@ -25,7 +25,7 @@ void *ngx_calloc(size_t size, ngx_log_t *log);
* allocations bigger than page size at the page boundary.
*/
-#if (HAVE_POSIX_MEMALIGN || HAVE_MEMALIGN)
+#if (NGX_HAVE_POSIX_MEMALIGN || NGX_HAVE_MEMALIGN)
void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log);
diff --git a/src/os/unix/ngx_channel.c b/src/os/unix/ngx_channel.c
index 0bfbd0de6..b1b36c5b3 100644
--- a/src/os/unix/ngx_channel.c
+++ b/src/os/unix/ngx_channel.c
@@ -17,7 +17,7 @@ ngx_int_t ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
struct iovec iov[1];
struct msghdr msg;
-#if (HAVE_MSGHDR_MSG_CONTROL)
+#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
union {
struct cmsghdr cm;
@@ -83,7 +83,7 @@ ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
struct iovec iov[1];
struct msghdr msg;
-#if (HAVE_MSGHDR_MSG_CONTROL)
+#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
union {
struct cmsghdr cm;
char space[CMSG_SPACE(sizeof(int))];
@@ -100,7 +100,7 @@ ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
msg.msg_iov = iov;
msg.msg_iovlen = 1;
-#if (HAVE_MSGHDR_MSG_CONTROL)
+#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
msg.msg_control = (caddr_t) &cmsg;
msg.msg_controllen = sizeof(cmsg);
#else
@@ -131,7 +131,7 @@ ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
return NGX_ERROR;
}
-#if (HAVE_MSGHDR_MSG_CONTROL)
+#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
if (ch->command == NGX_CMD_OPEN_CHANNEL) {
diff --git a/src/os/unix/ngx_errno.c b/src/os/unix/ngx_errno.c
index ced0eafcb..607b361d9 100644
--- a/src/os/unix/ngx_errno.c
+++ b/src/os/unix/ngx_errno.c
@@ -8,7 +8,7 @@
#include <ngx_core.h>
-#if (NGX_STRERROR_R)
+#if (NGX_HAVE_STRERROR_R)
u_char *ngx_strerror_r(int err, u_char *errstr, size_t size)
{
@@ -28,7 +28,7 @@ u_char *ngx_strerror_r(int err, u_char *errstr, size_t size)
return errstr;
}
-#elif (NGX_GNU_STRERROR_R)
+#elif (NGX_HAVE_GNU_STRERROR_R)
/* Linux strerror_r() */
diff --git a/src/os/unix/ngx_errno.h b/src/os/unix/ngx_errno.h
index e87ec5f6f..c1c5801d3 100644
--- a/src/os/unix/ngx_errno.h
+++ b/src/os/unix/ngx_errno.h
@@ -46,7 +46,7 @@ typedef int ngx_err_t;
#define ngx_set_socket_errno(err) errno = err
-#if (HAVE_STRERROR_R || HAVE_GNU_STRERROR_R)
+#if (NGX_HAVE_STRERROR_R || NGX_HAVE_GNU_STRERROR_R)
u_char *ngx_strerror_r(int err, u_char *errstr, size_t size);
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c
index 52aa9b62a..e67b2cac7 100644
--- a/src/os/unix/ngx_files.c
+++ b/src/os/unix/ngx_files.c
@@ -15,7 +15,7 @@ ssize_t ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
ngx_log_debug4(NGX_LOG_DEBUG_CORE, file->log, 0,
"read: %d, %p, %uz, %O", file->fd, buf, size, offset);
-#if (NGX_PREAD)
+#if (NGX_HAVE_PREAD)
n = pread(file->fd, buf, size, offset);
@@ -60,7 +60,7 @@ ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
ngx_log_debug4(NGX_LOG_DEBUG_CORE, file->log, 0,
"write: %d, %p, %uz, %O", file->fd, buf, size, offset);
-#if (NGX_PWRITE)
+#if (NGX_HAVE_PWRITE)
n = pwrite(file->fd, buf, size, offset);
diff --git a/src/os/unix/ngx_freebsd_config.h b/src/os/unix/ngx_freebsd_config.h
index 7f3b286c3..35bf1f502 100644
--- a/src/os/unix/ngx_freebsd_config.h
+++ b/src/os/unix/ngx_freebsd_config.h
@@ -60,23 +60,23 @@
#include <ngx_auto_config.h>
-#if (HAVE_POLL)
+#if (NGX_HAVE_POLL)
#include <poll.h>
#endif
-#if (HAVE_AIO)
+#if (NGX_HAVE_AIO)
#include <aio.h>
#endif
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
#include <sys/event.h>
#endif
-#if defined SO_ACCEPTFILTER && !defined HAVE_DEFERRED_ACCEPT
-#define HAVE_DEFERRED_ACCEPT 1
+#if defined SO_ACCEPTFILTER && !defined NGX_HAVE_DEFERRED_ACCEPT
+#define NGX_HAVE_DEFERRED_ACCEPT 1
#endif
@@ -91,8 +91,8 @@ pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);
#endif
-#ifndef HAVE_INHERITED_NONBLOCK
-#define HAVE_INHERITED_NONBLOCK 1
+#ifndef NGX_HAVE_INHERITED_NONBLOCK
+#define NGX_HAVE_INHERITED_NONBLOCK 1
#endif
diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c
index faf8e9f1e..b76dc0cb9 100644
--- a/src/os/unix/ngx_freebsd_init.c
+++ b/src/os/unix/ngx_freebsd_init.c
@@ -30,7 +30,7 @@ ngx_os_io_t ngx_os_io = {
ngx_unix_recv,
ngx_readv_chain,
ngx_unix_send,
-#if (HAVE_SENDFILE)
+#if (NGX_HAVE_SENDFILE)
ngx_freebsd_sendfile_chain,
NGX_IO_SENDFILE
#else
@@ -128,7 +128,7 @@ ngx_int_t ngx_os_init(ngx_log_t *log)
version = ngx_freebsd_kern_osreldate;
-#if (HAVE_SENDFILE)
+#if (NGX_HAVE_SENDFILE)
/*
* The determination of the sendfile() "nbytes bug" is complex enough.
@@ -161,7 +161,7 @@ ngx_int_t ngx_os_init(ngx_log_t *log)
#endif
-#endif /* HAVE_SENDFILE */
+#endif /* NGX_HAVE_SENDFILE */
if ((version < 500000 && version >= 440003) || version >= 500017) {
diff --git a/src/os/unix/ngx_freebsd_rfork_thread.c b/src/os/unix/ngx_freebsd_rfork_thread.c
index b64325bcd..5dfd46807 100644
--- a/src/os/unix/ngx_freebsd_rfork_thread.c
+++ b/src/os/unix/ngx_freebsd_rfork_thread.c
@@ -381,7 +381,7 @@ ngx_int_t ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try)
return NGX_AGAIN;
}
- if (ngx_freebsd_hw_ncpu > 1 && tries++ < 1000) {
+ if (ngx_ncpu > 1 && tries++ < 1000) {
/* the spinlock is used only on the SMP system */
@@ -581,7 +581,7 @@ ngx_cond_t *ngx_cond_init(ngx_log_t *log)
}
cv->signo = NGX_CV_SIGNAL;
- cv->tid = 0;
+ cv->tid = -1;
cv->log = log;
cv->kq = -1;
@@ -640,6 +640,8 @@ ngx_int_t ngx_cond_wait(ngx_cond_t *cv, ngx_mutex_t *m)
ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno, "kevent() failed");
return NGX_ERROR;
}
+
+ cv->tid = ngx_thread_self();
}
if (ngx_mutex_unlock(m) == NGX_ERROR) {
@@ -714,6 +716,10 @@ ngx_int_t ngx_cond_signal(ngx_cond_t *cv)
"cv %p to signal %P %d",
cv, cv->tid, cv->signo);
+ if (cv->tid == -1) {
+ return NGX_OK;
+ }
+
if (kill(cv->tid, cv->signo) == -1) {
err = ngx_errno;
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c
index 192a1a1ee..f86e1c0d7 100644
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -55,7 +55,7 @@ ngx_chain_t *ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
return in;
}
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
ngx_log_error(NGX_LOG_INFO, c->log, wev->kq_errno,
diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h
index 57ee5057e..620b59d8c 100644
--- a/src/os/unix/ngx_linux_config.h
+++ b/src/os/unix/ngx_linux_config.h
@@ -56,35 +56,37 @@
#include <sys/prctl.h>
#endif
+
#if (NGX_HAVE_SENDFILE64)
#include <sys/sendfile.h>
#else
extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
+#define NGX_SENDFILE_LIMIT (NGX_MAX_UINT32_VALUE + 1)
#endif
-#if (HAVE_POLL)
+#if (NGX_HAVE_POLL)
#include <poll.h>
#endif
-#if (HAVE_EPOLL)
+#if (NGX_HAVE_EPOLL)
#include <sys/epoll.h>
-#endif /* HAVE_EPOLL */
+#endif
-#if defined TCP_DEFER_ACCEPT && !defined HAVE_DEFERRED_ACCEPT
-#define HAVE_DEFERRED_ACCEPT 1
+#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
+#define NGX_HAVE_DEFERRED_ACCEPT 1
#endif
-#ifndef HAVE_INHERITED_NONBLOCK
-#define HAVE_INHERITED_NONBLOCK 0
+#ifndef NGX_HAVE_INHERITED_NONBLOCK
+#define NGX_HAVE_INHERITED_NONBLOCK 0
#endif
-#ifndef HAVE_SELECT_CHANGE_TIMEOUT
-#define HAVE_SELECT_CHANGE_TIMEOUT 1
+#ifndef NGX_HAVE_SELECT_CHANGE_TIMEOUT
+#define NGX_HAVE_SELECT_CHANGE_TIMEOUT 1
#endif
#ifndef NGX_SETPROCTITLE_USES_ENV
diff --git a/src/os/unix/ngx_linux_init.c b/src/os/unix/ngx_linux_init.c
index 397d342f0..9c1c84758 100644
--- a/src/os/unix/ngx_linux_init.c
+++ b/src/os/unix/ngx_linux_init.c
@@ -18,7 +18,7 @@ ngx_os_io_t ngx_os_io = {
ngx_unix_recv,
ngx_readv_chain,
ngx_unix_send,
-#if (HAVE_SENDFILE)
+#if (NGX_HAVE_SENDFILE)
ngx_linux_sendfile_chain,
NGX_IO_SENDFILE
#else
diff --git a/src/os/unix/ngx_linux_sendfile_chain.c b/src/os/unix/ngx_linux_sendfile_chain.c
index ad40f55d9..bcf9d4c76 100644
--- a/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/src/os/unix/ngx_linux_sendfile_chain.c
@@ -13,7 +13,7 @@
* On Linux up to 2.4.21 sendfile() (syscall #187) works with 32-bit
* offsets only and the including <sys/sendfile.h> breaks the compiling
* if off_t is 64 bit wide. So we use own sendfile() definition where offset
- * parameter is int32_t and use sendfile() with the file parts below 2G.
+ * parameter is int32_t and use sendfile() for the file parts below 2G only.
*
* Linux 2.4.21 has a new sendfile64() syscall #239.
*/
diff --git a/src/os/unix/ngx_os.h b/src/os/unix/ngx_os.h
index dc9f7a803..ee91df336 100644
--- a/src/os/unix/ngx_os.h
+++ b/src/os/unix/ngx_os.h
@@ -15,18 +15,6 @@
#define NGX_IO_SENDFILE 1
#define NGX_IO_ZEROCOPY 2
-#if (HAVE_SENDFILE)
-#define NGX_HAVE_SENDFILE NGX_IO_SENDFILE
-#else
-#define NGX_HAVE_SENDFILE 0
-#endif
-
-#if (HAVE_ZEROCOPY)
-#define NGX_HAVE_ZEROCOPY NGX_IO_ZEROCOPY
-#else
-#define NGX_HAVE_ZEROCOPY 0
-#endif
-
typedef ssize_t (*ngx_recv_pt)(ngx_connection_t *c, u_char *buf, size_t size);
typedef ssize_t (*ngx_recv_chain_pt)(ngx_connection_t *c, ngx_chain_t *in);
diff --git a/src/os/unix/ngx_posix_config.h b/src/os/unix/ngx_posix_config.h
index b187236e9..f9c91a4bf 100644
--- a/src/os/unix/ngx_posix_config.h
+++ b/src/os/unix/ngx_posix_config.h
@@ -70,17 +70,17 @@
#include <ngx_auto_config.h>
-#if (HAVE_POLL)
+#if (NGX_HAVE_POLL)
#include <poll.h>
#endif
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
#include <sys/event.h>
#endif
-#if (HAVE_DEVPOLL)
+#if (NGX_HAVE_DEVPOLL)
#include <sys/ioctl.h>
#include <sys/devpoll.h>
#endif
diff --git a/src/os/unix/ngx_posix_init.c b/src/os/unix/ngx_posix_init.c
index 19d65a489..56be0cefb 100644
--- a/src/os/unix/ngx_posix_init.c
+++ b/src/os/unix/ngx_posix_init.c
@@ -121,7 +121,7 @@ ngx_int_t ngx_posix_init(ngx_log_t *log)
ngx_max_sockets = rlmt.rlim_cur;
-#if (HAVE_INHERITED_NONBLOCK)
+#if (NGX_HAVE_INHERITED_NONBLOCK)
ngx_inherited_nonblocking = 1;
#else
ngx_inherited_nonblocking = 0;
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 37b2ef193..3d1c51bc0 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -607,6 +607,10 @@ static void ngx_master_exit(ngx_cycle_t *cycle)
static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
{
+ ngx_int_t n;
+ ngx_err_t err;
+ ngx_core_conf_t *ccf;
+
ngx_worker_process_init(cycle);
ngx_setproctitle("worker process");
@@ -618,6 +622,8 @@ static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
exit(2);
}
+ ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
+
if (ngx_threads_n) {
if (ngx_init_threads(ngx_threads_n,
ccf->thread_stack_size, cycle) == NGX_ERROR)
@@ -914,10 +920,9 @@ static void ngx_wakeup_worker_threads(ngx_cycle_t *cycle)
for (i = 0; i < ngx_threads_n; i++) {
if (ngx_threads[i].state < NGX_THREAD_EXIT) {
- ngx_cond_signal(ngx_threads[i].cv);
-
- if (ngx_threads[i].cv->tid == (ngx_tid_t) -1) {
+ if (ngx_cond_signal(ngx_threads[i].cv) == NGX_ERROR) {
ngx_threads[i].state = NGX_THREAD_DONE;
+
} else {
live = 1;
}
@@ -955,8 +960,6 @@ static void *ngx_worker_thread_cycle(void *data)
ngx_core_tls_t *tls;
ngx_cycle_t *cycle;
- thr->cv->tid = ngx_thread_self();
-
cycle = (ngx_cycle_t *) ngx_cycle;
sigemptyset(&set);
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c
index 2db998a86..7c57b7abe 100644
--- a/src/os/unix/ngx_readv_chain.c
+++ b/src/os/unix/ngx_readv_chain.c
@@ -9,7 +9,7 @@
#include <ngx_event.h>
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
{
@@ -136,7 +136,7 @@ ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
return n;
}
-#else /* ! NAVE_KQUEUE */
+#else /* ! NGX_HAVE_KQUEUE */
ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
{
@@ -216,4 +216,4 @@ ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
return n;
}
-#endif /* NAVE_KQUEUE */
+#endif /* NGX_HAVE_KQUEUE */
diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c
index d58ca9e3d..369be661a 100644
--- a/src/os/unix/ngx_recv.c
+++ b/src/os/unix/ngx_recv.c
@@ -9,7 +9,7 @@
#include <ngx_event.h>
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
{
@@ -115,7 +115,7 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
return n;
}
-#else /* ! NAVE_KQUEUE */
+#else /* ! NGX_HAVE_KQUEUE */
ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
{
@@ -170,4 +170,4 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
return n;
}
-#endif /* NAVE_KQUEUE */
+#endif /* NGX_HAVE_KQUEUE */
diff --git a/src/os/unix/ngx_send.c b/src/os/unix/ngx_send.c
index ff501c30a..ecd136265 100644
--- a/src/os/unix/ngx_send.c
+++ b/src/os/unix/ngx_send.c
@@ -17,7 +17,7 @@ ssize_t ngx_unix_send(ngx_connection_t *c, u_char *buf, size_t size)
wev = c->write;
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
ngx_log_error(NGX_LOG_INFO, c->log, wev->kq_errno,
diff --git a/src/os/unix/ngx_shared.c b/src/os/unix/ngx_shared.c
index 0edc8cbe1..80b5f601f 100644
--- a/src/os/unix/ngx_shared.c
+++ b/src/os/unix/ngx_shared.c
@@ -8,7 +8,7 @@
#include <ngx_core.h>
-#if (HAVE_MAP_ANON)
+#if (NGX_HAVE_MAP_ANON)
void *ngx_create_shared_memory(size_t size, ngx_log_t *log)
{
@@ -25,7 +25,7 @@ void *ngx_create_shared_memory(size_t size, ngx_log_t *log)
return p;
}
-#elif (HAVE_MAP_DEVZERO)
+#elif (NGX_HAVE_MAP_DEVZERO)
void *ngx_create_shared_memory(size_t size, ngx_log_t *log)
{
@@ -56,7 +56,7 @@ void *ngx_create_shared_memory(size_t size, ngx_log_t *log)
return p;
}
-#elif (HAVE_SYSVSHM)
+#elif (NGX_HAVE_SYSVSHM)
#include <sys/ipc.h>
#include <sys/shm.h>
diff --git a/src/os/unix/ngx_socket.c b/src/os/unix/ngx_socket.c
index da936b2fb..523f1f4ce 100644
--- a/src/os/unix/ngx_socket.c
+++ b/src/os/unix/ngx_socket.c
@@ -20,7 +20,7 @@
*/
-#if (HAVE_FIONBIO)
+#if (NGX_HAVE_FIONBIO)
int ngx_nonblocking(ngx_socket_t s)
{
diff --git a/src/os/unix/ngx_socket.h b/src/os/unix/ngx_socket.h
index 4dcf924e0..b381967e6 100644
--- a/src/os/unix/ngx_socket.h
+++ b/src/os/unix/ngx_socket.h
@@ -19,7 +19,7 @@ typedef int ngx_socket_t;
#define ngx_socket_n "socket()"
-#if (HAVE_FIONBIO)
+#if (NGX_HAVE_FIONBIO)
int ngx_nonblocking(ngx_socket_t s);
int ngx_blocking(ngx_socket_t s);
diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h
index 8f1841793..452850c0f 100644
--- a/src/os/unix/ngx_solaris_config.h
+++ b/src/os/unix/ngx_solaris_config.h
@@ -49,35 +49,35 @@
#include <ngx_auto_config.h>
-#if (HAVE_POLL)
+#if (NGX_HAVE_POLL)
#include <poll.h>
#endif
-#if (HAVE_SENDFILE)
+#if (NGX_HAVE_SENDFILE)
#include <sys/sendfile.h>
#endif
-#if (HAVE_AIO)
+#if (NGX_HAVE_AIO)
#include <aio.h>
#endif
-#if (HAVE_DEVPOLL)
+#if (NGX_HAVE_DEVPOLL)
#include <sys/ioctl.h>
#include <sys/devpoll.h>
#endif
-#ifndef HAVE_INHERITED_NONBLOCK
-#define HAVE_INHERITED_NONBLOCK 1
+#ifndef NGX_HAVE_INHERITED_NONBLOCK
+#define NGX_HAVE_INHERITED_NONBLOCK 1
#endif
-#ifndef HAVE_SO_SNDLOWAT
+#ifndef NGX_HAVE_SO_SNDLOWAT
/* setsockopt(SO_SNDLOWAT) returns error "Option not supported by protocol" */
-#define HAVE_SO_SNDLOWAT 0
+#define NGX_HAVE_SO_SNDLOWAT 0
#endif
diff --git a/src/os/unix/ngx_solaris_init.c b/src/os/unix/ngx_solaris_init.c
index c671197e0..03072edad 100644
--- a/src/os/unix/ngx_solaris_init.c
+++ b/src/os/unix/ngx_solaris_init.c
@@ -17,7 +17,7 @@ ngx_os_io_t ngx_os_io = {
ngx_unix_recv,
ngx_readv_chain,
ngx_unix_send,
-#if (HAVE_SENDFILE)
+#if (NGX_HAVE_SENDFILE)
ngx_solaris_sendfilev_chain,
NGX_IO_SENDFILE
#else
diff --git a/src/os/unix/ngx_thread.h b/src/os/unix/ngx_thread.h
index ac7cfad43..e630b356e 100644
--- a/src/os/unix/ngx_thread.h
+++ b/src/os/unix/ngx_thread.h
@@ -53,7 +53,6 @@ typedef struct {
typedef struct {
pthread_cond_t cond;
- ngx_tid_t tid;
ngx_log_t *log;
} ngx_cond_t;
diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c
index c4389503a..20ec4644b 100644
--- a/src/os/unix/ngx_time.c
+++ b/src/os/unix/ngx_time.c
@@ -10,7 +10,7 @@
void ngx_localtime(ngx_tm_t *tm)
{
-#if (HAVE_LOCALTIME_R)
+#if (NGX_HAVE_LOCALTIME_R)
time_t now;
now = ngx_time();
diff --git a/src/os/unix/ngx_time.h b/src/os/unix/ngx_time.h
index a6acf59e3..f257325d0 100644
--- a/src/os/unix/ngx_time.h
+++ b/src/os/unix/ngx_time.h
@@ -36,7 +36,7 @@ typedef struct tm ngx_tm_t;
#define ngx_tm_wday_t int
-#if (HAVE_GMTOFF)
+#if (NGX_HAVE_GMTOFF)
#define ngx_tm_gmtoff tm_gmtoff
#define ngx_tm_zone tm_zone
#endif
diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c
index e3893226d..2af64699b 100644
--- a/src/os/unix/ngx_writev_chain.c
+++ b/src/os/unix/ngx_writev_chain.c
@@ -30,7 +30,7 @@ ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
return in;
}
-#if (HAVE_KQUEUE)
+#if (NGX_HAVE_KQUEUE)
if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
ngx_log_error(NGX_LOG_INFO, c->log, wev->kq_errno,