comparison src/os/unix/ngx_files.c @ 416:a8e3f1441eec NGINX_0_7_17

nginx 0.7.17 *) Feature: now the "directio" directive works on Linux. *) Feature: the $pid variable. *) Bugfix: the "directio" optimization that had appeared in 0.7.15 did not work with open_file_cache. *) Bugfix: the "access_log" with variables did not work on Linux; the bug had appeared in 0.7.7. *) Bugfix: the ngx_http_charset_module did not understand quoted charset name received from backend.
author Igor Sysoev <http://sysoev.ru>
date Mon, 15 Sep 2008 00:00:00 +0400
parents 79c5df00501e
children ca8f7f6cab16
comparison
equal deleted inserted replaced
415:f6561f721532 416:a8e3f1441eec
387 387
388 388
389 #if (NGX_HAVE_O_DIRECT) 389 #if (NGX_HAVE_O_DIRECT)
390 390
391 ngx_int_t 391 ngx_int_t
392 ngx_directio(ngx_fd_t fd) 392 ngx_directio_on(ngx_fd_t fd)
393 { 393 {
394 int flags; 394 int flags;
395 395
396 flags = fcntl(fd, F_GETFL); 396 flags = fcntl(fd, F_GETFL);
397 397
400 } 400 }
401 401
402 return fcntl(fd, F_SETFL, flags | O_DIRECT); 402 return fcntl(fd, F_SETFL, flags | O_DIRECT);
403 } 403 }
404 404
405 #endif 405
406 ngx_int_t
407 ngx_directio_off(ngx_fd_t fd)
408 {
409 int flags;
410
411 flags = fcntl(fd, F_GETFL);
412
413 if (flags == -1) {
414 return -1;
415 }
416
417 return fcntl(fd, F_SETFL, flags & ~O_DIRECT);
418 }
419
420 #endif