aboutsummaryrefslogtreecommitdiff
path: root/src/os/win32/ngx_files.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-03-30 07:43:06 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-03-30 07:43:06 +0000
commit1be7419d10a4c2226783f280af9e2aa7ff48b738 (patch)
treeab1c63ea9b9edb9c1eddcc93c5c572230694ce4e /src/os/win32/ngx_files.c
parenta1e9bfbc859490e25f4fff07ddc5441c9a91abcc (diff)
downloadnginx-1be7419d10a4c2226783f280af9e2aa7ff48b738.tar.gz
nginx-1be7419d10a4c2226783f280af9e2aa7ff48b738.zip
ngx_fs_bsize()
Diffstat (limited to 'src/os/win32/ngx_files.c')
-rw-r--r--src/os/win32/ngx_files.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c
index eff843ab7..afe31b9a0 100644
--- a/src/os/win32/ngx_files.c
+++ b/src/os/win32/ngx_files.c
@@ -504,8 +504,28 @@ ngx_directio_on(ngx_fd_t fd)
return 0;
}
+
ngx_int_t
ngx_directio_off(ngx_fd_t fd)
{
return 0;
}
+
+
+size_t
+ngx_fs_bsize(u_char *name)
+{
+ u_char root[4];
+ u_long sc, bs, nfree, ncl;
+
+ if (name[2] == ':') {
+ ngx_cpystrn(root, name, 4);
+ name = root;
+ }
+
+ if (GetDiskFreeSpace((const char *) name, &sc, &bs, &nfree, &ncl) == 0) {
+ return 512;
+ }
+
+ return sc * bs;
+}