* 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.
This commit is contained in:
@@ -15,6 +15,7 @@ details. */
|
||||
#include <sys/cygwin.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/acl.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <signal.h>
|
||||
#include "cygerrno.h"
|
||||
#include "perprocess.h"
|
||||
@@ -486,6 +487,10 @@ fhandler_base::open (int flags, mode_t mode)
|
||||
switch (query_open ())
|
||||
{
|
||||
case query_read_control:
|
||||
access = READ_CONTROL;
|
||||
create_options = FILE_OPEN_FOR_BACKUP_INTENT;
|
||||
break;
|
||||
case query_read_attributes:
|
||||
access = READ_CONTROL | FILE_READ_ATTRIBUTES;
|
||||
create_options = FILE_OPEN_FOR_BACKUP_INTENT;
|
||||
break;
|
||||
@@ -1144,6 +1149,16 @@ fhandler_base::fstat (struct __stat64 *buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __stdcall
|
||||
fhandler_base::fstatvfs (struct statvfs *sfs)
|
||||
{
|
||||
/* If we hit this base implementation, it's some device in /dev.
|
||||
Just call statvfs on /dev for simplicity. */
|
||||
path_conv pc ("/dev");
|
||||
fhandler_disk_file fh (pc);
|
||||
return fh.fstatvfs (sfs);
|
||||
}
|
||||
|
||||
void
|
||||
fhandler_base::init (HANDLE f, DWORD a, mode_t bin)
|
||||
{
|
||||
|
Reference in New Issue
Block a user