diff options
Diffstat (limited to 'src/os/unix')
-rw-r--r-- | src/os/unix/ngx_errno.c | 2 | ||||
-rw-r--r-- | src/os/unix/ngx_freebsd_rfork_thread.c | 1 | ||||
-rw-r--r-- | src/os/unix/ngx_linux_config.h | 1 | ||||
-rw-r--r-- | src/os/unix/ngx_process_cycle.c | 1 | ||||
-rw-r--r-- | src/os/unix/ngx_process_cycle.h | 1 | ||||
-rw-r--r-- | src/os/unix/ngx_readv_chain.c | 2 | ||||
-rw-r--r-- | src/os/unix/ngx_recv.c | 2 | ||||
-rw-r--r-- | src/os/unix/ngx_solaris_config.h | 5 | ||||
-rw-r--r-- | src/os/unix/ngx_thread.h | 3 | ||||
-rw-r--r-- | src/os/unix/ngx_time.c | 69 |
10 files changed, 9 insertions, 78 deletions
diff --git a/src/os/unix/ngx_errno.c b/src/os/unix/ngx_errno.c index 410cfde5c..3b12528f7 100644 --- a/src/os/unix/ngx_errno.c +++ b/src/os/unix/ngx_errno.c @@ -43,7 +43,7 @@ ngx_int_t ngx_strerror_r(int err, char *errstr, size_t size) str = strerror_r(err, errstr, size); if (str != errstr) { - return ngx_cpystrn(errstr, str, size) - errstr; + return ngx_cpystrn(errstr, str, size) - (u_char *) errstr; } for (len = 0; len < size; len++) { diff --git a/src/os/unix/ngx_freebsd_rfork_thread.c b/src/os/unix/ngx_freebsd_rfork_thread.c index e100b93c6..1cdfee4e9 100644 --- a/src/os/unix/ngx_freebsd_rfork_thread.c +++ b/src/os/unix/ngx_freebsd_rfork_thread.c @@ -26,7 +26,6 @@ */ -ngx_int_t ngx_threaded; char *ngx_freebsd_kern_usrstack; size_t ngx_thread_stack_size; diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h index 23745df07..d36d665be 100644 --- a/src/os/unix/ngx_linux_config.h +++ b/src/os/unix/ngx_linux_config.h @@ -27,6 +27,7 @@ #include <sys/resource.h> #include <sys/sysctl.h> #include <sys/wait.h> +#include <sys/mman.h> #include <sys/socket.h> #include <netinet/in.h> #include <netinet/tcp.h> /* TCP_CORK */ diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index 1ae4deeb6..2410671f1 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -15,6 +15,7 @@ ngx_int_t ngx_process; ngx_pid_t ngx_pid; ngx_pid_t ngx_new_binary; ngx_int_t ngx_inherited; +ngx_int_t ngx_threaded; sig_atomic_t ngx_reap; sig_atomic_t ngx_timer; diff --git a/src/os/unix/ngx_process_cycle.h b/src/os/unix/ngx_process_cycle.h index 0c55afae8..364094a70 100644 --- a/src/os/unix/ngx_process_cycle.h +++ b/src/os/unix/ngx_process_cycle.h @@ -26,6 +26,7 @@ extern ngx_int_t ngx_process; extern ngx_pid_t ngx_pid; extern ngx_pid_t ngx_new_binary; extern ngx_int_t ngx_inherited; +extern ngx_int_t ngx_threaded; extern sig_atomic_t ngx_reap; extern sig_atomic_t ngx_timer; diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c index 3ec3b2761..49bb3ef3e 100644 --- a/src/os/unix/ngx_readv_chain.c +++ b/src/os/unix/ngx_readv_chain.c @@ -135,7 +135,7 @@ ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain) ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain) { - char *prev; + u_char *prev; ssize_t n, size; struct iovec *iov; ngx_err_t err; diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c index 37e70c6a3..63453503c 100644 --- a/src/os/unix/ngx_recv.c +++ b/src/os/unix/ngx_recv.c @@ -112,7 +112,7 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size) #else /* ! NAVE_KQUEUE */ -ssize_t ngx_unix_recv(ngx_connection_t *c, char *buf, size_t size) +ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size) { ssize_t n; ngx_err_t err; diff --git a/src/os/unix/ngx_solaris_config.h b/src/os/unix/ngx_solaris_config.h index db74aebe5..7c02c4455 100644 --- a/src/os/unix/ngx_solaris_config.h +++ b/src/os/unix/ngx_solaris_config.h @@ -22,10 +22,11 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> -#include <sys/filio.h> /* FIONBIO */ -#include <sys/stropts.h> /* INFTIM */ +#include <sys/mman.h> #include <sys/socket.h> #include <sys/sendfile.h> +#include <sys/filio.h> /* FIONBIO */ +#include <sys/stropts.h> /* INFTIM */ #include <sys/systeminfo.h> #include <netinet/in.h> #include <arpa/inet.h> diff --git a/src/os/unix/ngx_thread.h b/src/os/unix/ngx_thread.h index 841636a04..52252747e 100644 --- a/src/os/unix/ngx_thread.h +++ b/src/os/unix/ngx_thread.h @@ -102,9 +102,6 @@ ngx_int_t ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try); ngx_int_t ngx_mutex_unlock(ngx_mutex_t *m); -extern ngx_int_t ngx_threaded; - - #else /* !NGX_THREADS */ #define ngx_thread_volatile diff --git a/src/os/unix/ngx_time.c b/src/os/unix/ngx_time.c index 37039918e..221b64cd5 100644 --- a/src/os/unix/ngx_time.c +++ b/src/os/unix/ngx_time.c @@ -20,72 +20,3 @@ void ngx_localtime(ngx_tm_t *tm) tm->ngx_tm_mon++; tm->ngx_tm_year += 1900; } - - - -#if 0 - -typedef struct { - int busy; - u_int_64 msec; - time_t sec; - tm; - http_time_len; - http_time[n]; -}; - -volatile *ngx_time_p; - -ngx_time() -{ - p = ngx_time_p; -} - -ngx_update_time() -{ - u_int64 msec; - struct timeval tv; - - gettimeofday(&tv, NULL); - - msec = (unsigned long) tv.tv_sec * 1000 + tv.tv_usec / 1000; - p = ngx_time_p; - - /* minimum can be for example 0, 10, 50 or 100 ms */ - if (tv_sec > p->sec || msec - p->msec >= minimum) { - old_p = p; - /* max_tries < max_slots - 10, - max_slots should be more than max of threads */ - for (/* void */; i < max_tries; i++) { - if (++p >= last_slot) - p = first_slot; - - if (!test_and_set(p->busy) - break; - } - - if (i == max_tries) { - ngx_log_error(); - return; - } - - if (tv_sec > p->sec) { - p->sec = tv.tv.sec; - p->msec = msec; - localtime_r(&tv.tv_sec, tm); - make http stirng; - - } else { - ngx_memcpy(p->sec, old_p->sec, sizeof() - offset_of(, sec)); - p->msec = msec; - } - - /* here can be too seldom and non-critical race condition */ - if (ngx_time_p == old_p) - ngx_time_p = p; - - unlock(p->busy); - } -} - -#endif |