comparison src/os/unix/ngx_files.h @ 2248:1adec90a0e46

disable directio for unaligned reads in Linux
author Igor Sysoev <igor@sysoev.ru>
date Fri, 12 Sep 2008 13:50:12 +0000
parents c7c319896bb4
children 0864138899f1
comparison
equal deleted inserted replaced
2247:981483d63e9f 2248:1adec90a0e46
220 #define ngx_unlock_fd_n "fcntl(F_SETLK, F_UNLCK)" 220 #define ngx_unlock_fd_n "fcntl(F_SETLK, F_UNLCK)"
221 221
222 222
223 #if (NGX_HAVE_O_DIRECT) 223 #if (NGX_HAVE_O_DIRECT)
224 224
225 ngx_int_t ngx_directio(ngx_fd_t fd); 225 ngx_int_t ngx_directio_on(ngx_fd_t fd);
226 #define ngx_directio_n "fcntl(O_DIRECT)" 226 #define ngx_directio_on_n "fcntl(O_DIRECT)"
227
228 ngx_int_t ngx_directio_off(ngx_fd_t fd);
229 #define ngx_directio_off_n "fcntl(!O_DIRECT)"
227 230
228 #elif (NGX_HAVE_F_NOCACHE) 231 #elif (NGX_HAVE_F_NOCACHE)
229 232
230 #define ngx_directio(fd) fcntl(fd, F_NOCACHE, 1) 233 #define ngx_directio_on(fd) fcntl(fd, F_NOCACHE, 1)
231 #define ngx_directio_n "fcntl(F_NOCACHE)" 234 #define ngx_directio_on_n "fcntl(F_NOCACHE, 1)"
232 235
233 #elif (NGX_HAVE_DIRECTIO) 236 #elif (NGX_HAVE_DIRECTIO)
234 237
235 #define ngx_directio(fd) directio(fd, DIRECTIO_ON) 238 #define ngx_directio_on(fd) directio(fd, DIRECTIO_ON)
236 #define ngx_directio_n "directio(DIRECTIO_ON)" 239 #define ngx_directio_on_n "directio(DIRECTIO_ON)"
237 240
238 #else 241 #else
239 242
240 #define ngx_directio(fd) 0 243 #define ngx_directio_on(fd) 0
241 #define ngx_directio_n "ngx_directio_n" 244 #define ngx_directio_on_n "ngx_directio_on_n"
242 245
243 #endif 246 #endif
244 247
245 248
246 #endif /* _NGX_FILES_H_INCLUDED_ */ 249 #endif /* _NGX_FILES_H_INCLUDED_ */