diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-10-09 11:00:45 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-10-09 11:00:45 +0400 |
commit | 1342d9cc29de7b6509a44a49cd66d1038d1e6d26 (patch) | |
tree | 618ccc0244627bece991abd6a49b354b417e1a21 /src/os/unix/ngx_freebsd_init.c | |
parent | 3ae32483cd9315aef5066e2a06411e9ffb8a5560 (diff) |
nginx-0.0.1-2003-10-09-11:00:45 import
Diffstat (limited to 'src/os/unix/ngx_freebsd_init.c')
-rw-r--r-- | src/os/unix/ngx_freebsd_init.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c index 6eae456ed..ec4924e57 100644 --- a/src/os/unix/ngx_freebsd_init.c +++ b/src/os/unix/ngx_freebsd_init.c @@ -93,26 +93,30 @@ int ngx_os_init(ngx_log_t *log) #if (HAVE_FREEBSD_SENDFILE) - /* 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. - 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 works at least for RELEASEs - and for syscalls only (not libc_r wrapper). */ - - /* detect the new sendfile() version available at the compile time - to allow an old binary to run correctly on an updated FreeBSD system. */ + /* + * 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. + * Besides libc_r wrapper also emulates the bug in some versions. + * There's no way to say exactly if a given FreeBSD version has the bug. + * Here is the algorithm that works at least for RELEASEs + * and for syscalls only (not libc_r wrapper). + * + * We 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) \ || __FreeBSD_version == 460002 || __FreeBSD_version >= 500039 /* a new syscall without the bug */ + ngx_freebsd_sendfile_nbytes_bug = 0; #else /* an old syscall that can have the bug */ + ngx_freebsd_sendfile_nbytes_bug = 1; #endif |