* 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:
@@ -1,6 +1,6 @@
|
||||
/* fhandler_virtual.cc: base fhandler class for virtual filesystems
|
||||
|
||||
Copyright 2002, 2003, 2004, 2005 Red Hat, Inc.
|
||||
Copyright 2002, 2003, 2004, 2005, 2007 Red Hat, Inc.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
@@ -13,6 +13,7 @@ details. */
|
||||
#include <stdlib.h>
|
||||
#include <sys/cygwin.h>
|
||||
#include <sys/acl.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include "cygerrno.h"
|
||||
#include "security.h"
|
||||
#include "path.h"
|
||||
@@ -261,3 +262,14 @@ fhandler_virtual::facl (int cmd, int nentries, __aclent32_t *aclbufp)
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int __stdcall
|
||||
fhandler_virtual::fstatvfs (struct statvfs *sfs)
|
||||
{
|
||||
/* Virtual file system. Just return an empty buffer with a few values
|
||||
set to something useful. Just as on Linux. */
|
||||
memset (sfs, 0, sizeof (*sfs));
|
||||
sfs->f_bsize = sfs->f_frsize = 4096;
|
||||
sfs->f_namemax = NAME_MAX;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user