Mercurial > hg > nginx
comparison src/os/unix/ngx_files.h @ 3178:975f0558aab3
read_ahead
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 30 Sep 2009 13:21:52 +0000 |
parents | 6060225e9261 |
children | 26784c34e8be |
comparison
equal
deleted
inserted
replaced
3177:adc4fc0c3cc3 | 3178:975f0558aab3 |
---|---|
252 #define ngx_trylock_fd_n "fcntl(F_SETLK, F_WRLCK)" | 252 #define ngx_trylock_fd_n "fcntl(F_SETLK, F_WRLCK)" |
253 #define ngx_lock_fd_n "fcntl(F_SETLKW, F_WRLCK)" | 253 #define ngx_lock_fd_n "fcntl(F_SETLKW, F_WRLCK)" |
254 #define ngx_unlock_fd_n "fcntl(F_SETLK, F_UNLCK)" | 254 #define ngx_unlock_fd_n "fcntl(F_SETLK, F_UNLCK)" |
255 | 255 |
256 | 256 |
257 #if (NGX_HAVE_F_READAHEAD) | |
258 | |
259 #define NGX_HAVE_READ_AHEAD 1 | |
260 | |
261 #define ngx_read_ahead(fd, n) fcntl(fd, F_READAHEAD, (int) n) | |
262 #define ngx_read_ahead_n "fcntl(fd, F_READAHEAD)" | |
263 | |
264 #elif (NGX_HAVE_POSIX_FADVISE) | |
265 | |
266 #define NGX_HAVE_READ_AHEAD 1 | |
267 | |
268 #define ngx_read_ahead(fd, n) posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL) | |
269 #define ngx_read_ahead_n "posix_fadvise(POSIX_FADV_SEQUENTIAL)" | |
270 | |
271 #else | |
272 | |
273 #define ngx_read_ahead(fd, n) 0 | |
274 #define ngx_read_ahead_n "ngx_read_ahead_n" | |
275 | |
276 #endif | |
277 | |
278 | |
257 #if (NGX_HAVE_O_DIRECT) | 279 #if (NGX_HAVE_O_DIRECT) |
258 | 280 |
259 ngx_int_t ngx_directio_on(ngx_fd_t fd); | 281 ngx_int_t ngx_directio_on(ngx_fd_t fd); |
260 #define ngx_directio_on_n "fcntl(O_DIRECT)" | 282 #define ngx_directio_on_n "fcntl(O_DIRECT)" |
261 | 283 |