Mercurial > hg > nginx
comparison src/os/unix/ngx_freebsd_init.c @ 361:446782c909b3
nginx-0.0.7-2004-06-20-23:54:15 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 20 Jun 2004 19:54:15 +0000 |
parents | ee394e997c77 |
children | 018569a8f09c |
comparison
equal
deleted
inserted
replaced
360:239e37d44a34 | 361:446782c909b3 |
---|---|
119 | 119 |
120 | 120 |
121 #if (HAVE_SENDFILE) | 121 #if (HAVE_SENDFILE) |
122 | 122 |
123 /* | 123 /* |
124 * The determination of the sendfile() nbytes bug is complex enough. | 124 * The determination of the sendfile() "nbytes bug" is complex enough. |
125 * There are two sendfile() syscalls: a new #393 has no bug while | 125 * There are two sendfile() syscalls: a new #393 has no bug while |
126 * an old #336 has the bug in some versions and has not in others. | 126 * an old #336 has the bug in some versions and has not in others. |
127 * Besides libc_r wrapper also emulates the bug in some versions. | 127 * Besides libc_r wrapper also emulates the bug in some versions. |
128 * There's no way to say exactly if a given FreeBSD version has the bug. | 128 * There's no way to say exactly if a given FreeBSD version has the bug. |
129 * Here is the algorithm that works at least for RELEASEs | 129 * We use the algorithm that is correct at least for RELEASEs |
130 * and for syscalls only (not libc_r wrapper). | 130 * and for syscalls only (not libc_r wrapper). |
131 * | 131 * |
132 * We detect the new sendfile() version available at the compile time | 132 * 4.6.1-RELEASE and below have the bug |
133 * 4.6.2-RELEASE and above have the new syscall | |
134 * | |
135 * We detect the new sendfile() syscall available at the compile time | |
133 * to allow an old binary to run correctly on an updated FreeBSD system. | 136 * to allow an old binary to run correctly on an updated FreeBSD system. |
134 */ | 137 */ |
135 | 138 |
136 #if (__FreeBSD__ == 4 && __FreeBSD_version >= 460102) \ | 139 #if (__FreeBSD__ == 4 && __FreeBSD_version >= 460102) \ |
137 || __FreeBSD_version == 460002 || __FreeBSD_version >= 500039 | 140 || __FreeBSD_version == 460002 || __FreeBSD_version >= 500039 |
140 | 143 |
141 ngx_freebsd_sendfile_nbytes_bug = 0; | 144 ngx_freebsd_sendfile_nbytes_bug = 0; |
142 | 145 |
143 #else | 146 #else |
144 | 147 |
145 /* an old syscall that can have the bug */ | 148 /* an old syscall that may have the bug */ |
146 | 149 |
147 ngx_freebsd_sendfile_nbytes_bug = 1; | 150 ngx_freebsd_sendfile_nbytes_bug = 1; |
148 | 151 |
149 #endif | 152 #endif |
150 | 153 |