aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_files.h
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-04-22 10:06:43 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-04-22 10:06:43 +0000
commitef1f33b0db5a69afeb4272668089ed5f760aea68 (patch)
tree5d654c5adb83ebb96f990ff3ae85930fc354fc8c /src/os/unix/ngx_files.h
parent64efecc2b5e6824422703a4fd5106c70d4704ef0 (diff)
downloadnginx-ef1f33b0db5a69afeb4272668089ed5f760aea68.tar.gz
nginx-ef1f33b0db5a69afeb4272668089ed5f760aea68.zip
Use more precise stat.st_blocks to account cache size on Unix
instead of file length rounded to a file system block size. There is no similar way on Windows, so rounding to a cache->bsize is kept.
Diffstat (limited to 'src/os/unix/ngx_files.h')
-rw-r--r--src/os/unix/ngx_files.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index b7bfff100..037c9a165 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -157,6 +157,7 @@ ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s);
#define ngx_is_exec(sb) (((sb)->st_mode & S_IXUSR) == S_IXUSR)
#define ngx_file_access(sb) ((sb)->st_mode & 0777)
#define ngx_file_size(sb) (sb)->st_size
+#define ngx_file_fs_size(sb) ((sb)->st_blocks * 512)
#define ngx_file_mtime(sb) (sb)->st_mtime
#define ngx_file_uniq(sb) (sb)->st_ino