diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-02-27 15:58:56 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-02-27 15:58:56 +0300 |
commit | 3323df7e0ed8be20dcd1643212858399514dd158 (patch) | |
tree | 04a9df97d7a82e2b766f634b0f714b88629f6a0b /winsup/cygwin/fhandler_socket.cc | |
parent | 7706962caf00263d7a142e72680a6cea16f5fa5a (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_socket.cc')
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index d2ae0cca1..d5384fe46 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -36,6 +36,7 @@ #include "wininfo.h" #include <unistd.h> #include <sys/acl.h> +#include <sys/statvfs.h> #include "cygtls.h" #include "cygwin/in6.h" @@ -666,6 +667,19 @@ fhandler_socket::fstat (struct __stat64 *buf) return res; } +int __stdcall +fhandler_socket::fstatvfs (struct statvfs *sfs) +{ + if (get_device () == FH_UNIX) + { + fhandler_disk_file fh (pc); + fh.get_device () = FH_FS; + return fh.fstatvfs (sfs); + } + set_errno (EBADF); + return -1; +} + int fhandler_socket::fchmod (mode_t mode) { @@ -677,7 +691,8 @@ fhandler_socket::fchmod (mode_t mode) SetFileAttributes (pc, GetFileAttributes (pc) | FILE_ATTRIBUTE_SYSTEM); return ret; } - return 0; + set_errno (EBADF); + return -1; } int @@ -688,7 +703,8 @@ fhandler_socket::fchown (__uid32_t uid, __gid32_t gid) fhandler_disk_file fh (pc); return fh.fchown (uid, gid); } - return 0; + set_errno (EBADF); + return -1; } int @@ -699,7 +715,8 @@ fhandler_socket::facl (int cmd, int nentries, __aclent32_t *aclbufp) fhandler_disk_file fh (pc); return fh.facl (cmd, nentries, aclbufp); } - return fhandler_base::facl (cmd, nentries, aclbufp); + set_errno (EBADF); + return -1; } int |