[nginx] Fixed compilation without O_DIRECT, broken by 9359:31419...

Maxim Dounin mdounin at mdounin.ru
Mon May 26 19:52:29 UTC 2025


details:   http://freenginx.org/hg/nginx/rev/d1edde45c5f1
branches:  
changeset: 9362:d1edde45c5f1
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon May 26 22:49:07 2025 +0300
description:
Fixed compilation without O_DIRECT, broken by 9359:314192d67a91.

diffstat:

 src/os/unix/ngx_files.h |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (29 lines):

diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -336,16 +336,25 @@ ngx_int_t ngx_directio_off(ngx_fd_t fd);
 #define ngx_directio_on(fd)      fcntl(fd, F_NOCACHE, 1)
 #define ngx_directio_on_n        "fcntl(F_NOCACHE, 1)"
 
+#define ngx_directio_off(fd)     fcntl(fd, F_NOCACHE, 0)
+#define ngx_directio_off_n       "fcntl(F_NOCACHE, 0)"
+
 #elif (NGX_HAVE_DIRECTIO)
 
 #define ngx_directio_on(fd)      directio(fd, DIRECTIO_ON)
 #define ngx_directio_on_n        "directio(DIRECTIO_ON)"
 
+#define ngx_directio_off(fd)     directio(fd, DIRECTIO_OFF)
+#define ngx_directio_off_n       "directio(DIRECTIO_OFF)"
+
 #else
 
 #define ngx_directio_on(fd)      0
 #define ngx_directio_on_n        "ngx_directio_on_n"
 
+#define ngx_directio_off(fd)     0
+#define ngx_directio_off_n       "ngx_directio_off_n"
+
 #endif
 
 size_t ngx_fs_bsize(u_char *name);


More information about the nginx-devel mailing list