aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_files.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-07-30 12:34:04 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-07-30 12:34:04 +0000
commit385af286421e983f744f7f5d339b8060ccd36302 (patch)
tree81c46d0dad40506cc3a331c6ffaf454da85a0177 /src/os/unix/ngx_files.c
parent749449097847cc3bee9e4e3966122a94149b755b (diff)
downloadnginx-385af286421e983f744f7f5d339b8060ccd36302.tar.gz
nginx-385af286421e983f744f7f5d339b8060ccd36302.zip
directio
Diffstat (limited to 'src/os/unix/ngx_files.c')
-rw-r--r--src/os/unix/ngx_files.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/os/unix/ngx_files.c b/src/os/unix/ngx_files.c
index 7ee8cbd84..e2148d843 100644
--- a/src/os/unix/ngx_files.c
+++ b/src/os/unix/ngx_files.c
@@ -351,3 +351,22 @@ ngx_unlock_fd(ngx_fd_t fd)
return 0;
}
+
+
+#if (NGX_HAVE_O_DIRECT)
+
+ngx_int_t
+ngx_directio(ngx_fd_t fd)
+{
+ int flags;
+
+ flags = fcntl(fd, F_GETFL);
+
+ if (flags == -1) {
+ return -1;
+ }
+
+ return fcntl(fd, F_SETFL, flags | O_DIRECT);
+}
+
+#endif