aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-09-01 05:15:56 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-09-01 05:15:56 +0000
commitdc1e3060eb9244a0d325f1dae7fe88757066b90d (patch)
tree6377e78c0c5077229d900a51581ab38bd8533275 /src
parentacdb80aed45272782ad664eeb9687f1a14b844d5 (diff)
downloadnginx-dc1e3060eb9244a0d325f1dae7fe88757066b90d.tar.gz
nginx-dc1e3060eb9244a0d325f1dae7fe88757066b90d.zip
Linux O_NOATIME support
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_index_module.c3
-rw-r--r--src/http/modules/ngx_http_static_module.c3
-rw-r--r--src/os/unix/ngx_files.h5
-rw-r--r--src/os/win32/ngx_files.h1
4 files changed, 10 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index cd1c51ee5..b84a65e61 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -239,7 +239,8 @@ ngx_http_index_handler(ngx_http_request_t *r)
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- fd = ngx_open_file(ctx->path.data, NGX_FILE_RDONLY, NGX_FILE_OPEN);
+ fd = ngx_open_file(ctx->path.data, NGX_FILE_RDONLY|NGX_FILE_NOATIME,
+ NGX_FILE_OPEN);
if (fd == (ngx_fd_t) NGX_AGAIN) {
ctx->current = i;
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index f9df46eeb..414461099 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -125,7 +125,8 @@ ngx_http_static_handler(ngx_http_request_t *r)
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- fd = ngx_open_file(path.data, NGX_FILE_RDONLY, NGX_FILE_OPEN);
+ fd = ngx_open_file(path.data, NGX_FILE_RDONLY|NGX_FILE_NOATIME,
+ NGX_FILE_OPEN);
if (fd == NGX_INVALID_FILE) {
err = ngx_errno;
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index ff2515699..a5724bd20 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -28,6 +28,11 @@
#define NGX_FILE_TRUNCATE O_TRUNC
#define NGX_FILE_APPEND O_APPEND
+#ifdef O_NOATIME
+#define NGX_FILE_NOATIME O_NOATIME
+#else
+#define NGX_FILE_NOATIME 0
+#endif
#define ngx_close_file close
#define ngx_close_file_n "close()"
diff --git a/src/os/win32/ngx_files.h b/src/os/win32/ngx_files.h
index c42c055f3..57607e3e7 100644
--- a/src/os/win32/ngx_files.h
+++ b/src/os/win32/ngx_files.h
@@ -42,6 +42,7 @@
#define NGX_FILE_CREATE_OR_OPEN OPEN_ALWAYS
#define NGX_FILE_OPEN OPEN_EXISTING
#define NGX_FILE_APPEND 0
+#define NGX_FILE_NOATIME 0
ngx_int_t ngx_file_append_mode(ngx_fd_t fd);