diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-06-02 15:24:30 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-06-02 15:24:30 +0000 |
commit | 7578ec9df43bbb31db5291f1b76359d10900a679 (patch) | |
tree | 87d7b3cb729c0e07b21d52737fd76e12a0c17d72 /src/os/unix/ngx_freebsd_init.c | |
parent | aa3436c04c222d57498bfa34c9fdec50f07fd08d (diff) | |
download | nginx-7578ec9df43bbb31db5291f1b76359d10900a679.tar.gz nginx-7578ec9df43bbb31db5291f1b76359d10900a679.zip |
nginx-0.0.1-2003-06-02-19:24:30 import
Diffstat (limited to 'src/os/unix/ngx_freebsd_init.c')
-rw-r--r-- | src/os/unix/ngx_freebsd_init.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c index cacc4579f..e01f9b613 100644 --- a/src/os/unix/ngx_freebsd_init.c +++ b/src/os/unix/ngx_freebsd_init.c @@ -9,6 +9,7 @@ int ngx_freebsd_kern_osreldate; int ngx_freebsd_hw_ncpu; int ngx_freebsd_net_inet_tcp_sendspace; int ngx_freebsd_sendfile_nbytes_bug; +int ngx_freebsd_tcp_nopush_flush; /* FreeBSD 5.0 */ int ngx_freebsd_kern_ipc_zero_copy_send; @@ -39,6 +40,8 @@ sysctl_t sysctls[] = { &ngx_freebsd_net_inet_tcp_sendspace, sizeof(int)}, + /* FreeBSD 5.0 */ + {"kern.ipc.zero_copy.send", &ngx_freebsd_kern_ipc_zero_copy_send, sizeof(int)}, @@ -49,7 +52,7 @@ sysctl_t sysctls[] = { int ngx_os_init(ngx_log_t *log) { - int i; + int i, version; size_t size; ngx_err_t err; @@ -81,9 +84,11 @@ int ngx_os_init(ngx_log_t *log) return NGX_ERROR; } + version = ngx_freebsd_kern_osreldate; + ngx_log_error(NGX_LOG_INFO, log, 0, "kern.osreldate: %d, built on %d", - ngx_freebsd_kern_osreldate, __FreeBSD_version); + version, __FreeBSD_version); #if (HAVE_FREEBSD_SENDFILE) @@ -91,12 +96,12 @@ int ngx_os_init(ngx_log_t *log) /* The determination of the sendfile() nbytes bug is complex enough. There're two sendfile() syscalls: a new 393 has no bug while an old 336 has the bug in some versions and has not in others. - libc_r wrapper also emulates the bug in some versions. + Besides libc_r wrapper also emulates the bug in some versions. There's no way to say exactly if a given FreeBSD version has bug. - Here is the algorithm that work at least for RELEASEs + Here is the algorithm that works at least for RELEASEs and for syscalls only (not libc_r wrapper). */ - /* detect was the new sendfile() version available at the compile time + /* detect the new sendfile() version available at the compile time to allow an old binary to run correctly on an updated FreeBSD system. */ #if (__FreeBSD__ == 4 && __FreeBSD_version >= 460102) \ @@ -115,6 +120,11 @@ int ngx_os_init(ngx_log_t *log) #endif /* HAVE_FREEBSD_SENDFILE */ + if ((version < 500000 && version >= 440003) || version >= 500017) { + ngx_freebsd_tcp_nopush_flush = 1; + } + + for (i = 0; sysctls[i].name; i++) { *sysctls[i].value = 0; size = sysctls[i].size; |