Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-02-27 15:58:56 +0300
committerCorinna Vinschen <corinna@vinschen.de>2007-02-27 15:58:56 +0300
commit3323df7e0ed8be20dcd1643212858399514dd158 (patch)
tree04a9df97d7a82e2b766f634b0f714b88629f6a0b /winsup/cygwin/fhandler_fifo.cc
parent7706962caf00263d7a142e72680a6cea16f5fa5a (diff)
* fhandler.cc(fhandler_base::open): Open with READ_CONTROL only in
case of query_open flag set to query_read_control. Add case for new query_read_attributes flag. (fhandler_base::fstatvfs): New method. * fhandler.h (enum query_state): Add query_read_attributes flag. (class fhandler_base): Declare new virtual fstatvfs method. (class fhandler_socket): Ditto. (class fhandler_pipe): Ditto. (class fhandler_fifo): Ditto. (class fhandler_disk_file): Ditto. (class fhandler_virtual): Ditto. * fhandler_disk_file.cc (fhandler_base::fstat_fs): Open with query_read_attributes instead of query_read_control. (fhandler_disk_file::fstatvfs): New method. (fhandler_disk_file::facl): Open with query_read_attributes instead of query_read_control. * fhandler_fifo.cc (fhandler_fifo::fstatvfs): New method. * fhandler_socket.cc (fhandler_socket::fstatvfs): New method. (fhandler_socket::fchmod): Return with EBADF in the default case. (fhandler_socket::fchown): Ditto. (fhandler_socket::facl): Ditto. * fhandler_virtual.cc (fhandler_virtual::fstatvfs): Ditto. * ntdll.h (struct _FILE_FS_ATTRIBUTE_INFORMATION): Define. (struct _FILE_FS_FULL_SIZE_INFORMATION): Define. * pipe.cc (fhandler_pipe::fstatvfs): New method. * syscalls.cc (fstatvfs): Just call the fhandler's fstatvfs. (statvfs): Ditto. (fstatfs): Call fstatvfs. (statfs): Drop EFAULT handling.
Diffstat (limited to 'winsup/cygwin/fhandler_fifo.cc')
-rw-r--r--winsup/cygwin/fhandler_fifo.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 8f5e793f7..9143be741 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -1,6 +1,6 @@
/* fhandler_fifo.cc - See fhandler.h for a description of the fhandler classes.
- Copyright 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc.
This file is part of Cygwin.
@@ -12,6 +12,7 @@
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
+#include <sys/statvfs.h>
#include "cygerrno.h"
#include "perprocess.h"
@@ -238,3 +239,18 @@ fhandler_fifo::dup (fhandler_base *child)
}
return res;
}
+
+int __stdcall
+fhandler_fifo::fstatvfs (struct statvfs *sfs)
+{
+ /* Call statvfs on parent dir. */
+ char *c, dir[CYG_MAX_PATH];
+ strcpy (dir, get_name ());
+ if ((c = strrchr (dir, '/')))
+ {
+ *c = '\0';
+ return statvfs (dir, sfs);
+ }
+ set_errno (EBADF);
+ return -1;
+}