From 2a24463d0bfef5d94e0918583cfffcf3a949f0df Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 12 Apr 2005 14:26:31 +0000 Subject: * autoload.cc (NtQueryVolumeInformationFile): Add. * fhandler.cc (fhandler_base::raw_write): Don't touch has_changed flag. * fhandler.h (enum change_state): Remove. (fhandler_base::status): Revert has_changed to a simple bit. (fhandler_base::fstat_helper): Add nAllocSize parameter. Rename ftCreationTime to ftChangeTime. * fhandler_disk_file.cc: Call fstat_helper with additional allocation size throughout. (fhandler_base::fstat_by_handle): Use NT native functions to get full file information on NT. Call fstat_helper with LastWriteTime as ctime, if ChangeTime is not available. (fhandler_base::fstat_by_name): Call fstat_helper with LastWriteTime as ctime. (fhandler_base::fstat_helper): Add comment. Drop special FAT handling since it's useless. Use nAllocSize for st_blocks if available. (fhandler_disk_file::touch_ctime): Only touch LastWriteTime. (fhandler_disk_file::fchmod): Set has_changed on 9x only. (fhandler_disk_file::fchown): Don't set has_changed. (fhandler_disk_file::facl): Ditto. (fhandler_disk_file::ftruncate): Ditto. (fhandler_disk_file::link): Set has_changed on 9x only and on original file only. (fhandler_base::open_fs): Don't set has_changed in O_TRUNC case. * ntdll.h (FILE_BASIC_INFORMATION): Define. (FILE_STANDARD_INFORMATION): Define. (FILE_INTERNAL_INFORMATION): Define. (FILE_EA_INFORMATION): Define. (FILE_ACCESS_INFORMATION): Define. (FILE_POSITION_INFORMATION): Define. (FILE_MODE_INFORMATION): Define. (FILE_ALIGNMENT_INFORMATION): Define. (FILE_NAME_INFORMATION): Don't define with arbitrary FileName size. (FILE_ALL_INFORMATION): Define. (FILE_INFORMATION_CLASS): Add FileAllInformation. (FILE_FS_VOLUME_INFORMATION): Define. (FS_INFORMATION_CLASS): Define. (NtQueryVolumeInformationFile): Define. --- winsup/cygwin/fhandler.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index e1ad64aa2..12c5b6445 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -78,12 +78,6 @@ enum query_state { query_write_attributes = 4 }; -enum change_state { - no_change = 0, - inode_changed = 1, - data_changed = 2 -}; - class fhandler_base { friend class dtable; @@ -106,14 +100,14 @@ class fhandler_base read or write access */ unsigned close_on_exec : 1; /* close-on-exec */ unsigned need_fork_fixup : 1; /* Set if need to fixup after fork. */ - unsigned has_changed : 2; /* Flag used to set ctime on close. */ + unsigned has_changed : 1; /* Flag used to set ctime on close. */ public: status_flags () : rbinary (0), rbinset (0), wbinary (0), wbinset (0), nohandle (0), uninterruptible_io (0), append_mode (0), did_lseek (0), query_open (no_query), close_on_exec (0), need_fork_fixup (0), - has_changed (no_change) + has_changed (0) {} } status, open_status; @@ -194,7 +188,7 @@ class fhandler_base IMPLEMENT_STATUS_FLAG (query_state, query_open) IMPLEMENT_STATUS_FLAG (bool, close_on_exec) IMPLEMENT_STATUS_FLAG (bool, need_fork_fixup) - IMPLEMENT_STATUS_FLAG (change_state, has_changed) + IMPLEMENT_STATUS_FLAG (bool, has_changed) int get_default_fmode (int flags); @@ -264,12 +258,13 @@ class fhandler_base virtual int __stdcall fstat (struct __stat64 *buf) __attribute__ ((regparm (2))); int __stdcall fstat_fs (struct __stat64 *buf) __attribute__ ((regparm (2))); int __stdcall fstat_helper (struct __stat64 *buf, - FILETIME ftCreationTime, + FILETIME ftChangeTime, FILETIME ftLastAccessTime, FILETIME ftLastWriteTime, DWORD dwVolumeSerialNumber, DWORD nFileSizeHigh, DWORD nFileSizeLow, + LONGLONG nAllocSize, DWORD nFileIndexHigh, DWORD nFileIndexLow, DWORD nNumberOfLinks) -- cgit v1.2.3