diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-03-06 17:48:25 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-03-06 17:48:25 +0300 |
commit | 70de8290c83f19354784c85a0ed97c825a741efe (patch) | |
tree | f6c1579a023f8c9abfdbeb7bf0dd962b7dc31c5c /winsup | |
parent | 4e747c10dc67cab8988e50d13ffa727dd52c584d (diff) |
* fhandler_mailslot.cc (fhandler_mailslot::fstat): Set new stat member
st_birthtim to useful value.
* fhandler_process.cc (fhandler_process::fstat): Ditto.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Take
additional parameter for creation time. Fill st_birthtim with it.
Accomodate additional creation time parameter throughout.
* fhandler_raw.cc (fhandler_dev_raw::fstat): Set new stat member
st_birthtim to useful value.
* fhandler.cc (fhandler_base::fstat): Ditto.
* fhandler_registry.cc (fhandler_registry::fstat): Ditto.
* include/cygwin/version.h: Bump API minor number.
* include/cygwin/stat.h (struct __stat64): Replace st_spare4 with
timestruc_t st_birthtim.
(struct stat): Ditto if __CYGWIN_USE_BIG_TYPES__ is defined.
(st_birthtime): Define if __CYGWIN_USE_BIG_TYPES__ is defined.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 18 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 10 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_mailslot.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_process.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_raw.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/stat.h | 11 | ||||
-rw-r--r-- | winsup/cygwin/include/cygwin/version.h | 3 |
9 files changed, 43 insertions, 12 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0d5144b1f..3072289b1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,21 @@ +2007-03-06 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_mailslot.cc (fhandler_mailslot::fstat): Set new stat member + st_birthtim to useful value. + * fhandler_process.cc (fhandler_process::fstat): Ditto. + * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Take + additional parameter for creation time. Fill st_birthtim with it. + Accomodate additional creation time parameter throughout. + * fhandler_raw.cc (fhandler_dev_raw::fstat): Set new stat member + st_birthtim to useful value. + * fhandler.cc (fhandler_base::fstat): Ditto. + * fhandler_registry.cc (fhandler_registry::fstat): Ditto. + * include/cygwin/version.h: Bump API minor number. + * include/cygwin/stat.h (struct __stat64): Replace st_spare4 with + timestruc_t st_birthtim. + (struct stat): Ditto if __CYGWIN_USE_BIG_TYPES__ is defined. + (st_birthtime): Define if __CYGWIN_USE_BIG_TYPES__ is defined. + 2007-03-02 Corinna Vinschen <corinna@vinschen.de> * ntdll.h (struct _OBJECT_NAME_INFORMATION): Define. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 33ef6ae4e..5f46484f9 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -1143,7 +1143,7 @@ fhandler_base::fstat (struct __stat64 *buf) buf->st_blksize = PREFERRED_IO_BLKSIZE; buf->st_ctim.tv_sec = 1164931200L; /* Arbitrary value: 2006-12-01 */ buf->st_ctim.tv_nsec = 0L; - buf->st_atim = buf->st_mtim = buf->st_ctim; + buf->st_atim = buf->st_mtim = buf->st_birthtim = buf->st_ctim; return 0; } diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index f40bcb52d..d510ff0f0 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -246,6 +246,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf) *(FILETIME *) &pfai->BasicInformation.LastWriteTime, *(FILETIME *) &pfai->BasicInformation.LastAccessTime, *(FILETIME *) &pfai->BasicInformation.LastWriteTime, + *(FILETIME *) &pfai->BasicInformation.CreationTime, pfvi->VolumeSerialNumber, pfai->StandardInformation.EndOfFile.QuadPart, pfai->StandardInformation.AllocationSize.QuadPart, @@ -264,7 +265,7 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf) lowfs = GetFileSize (get_handle (), &highfs); if (lowfs == 0xffffffff && GetLastError ()) lowfs = highfs = 0; - return fstat_helper (buf, ft, ft, ft, 0, (ULONGLONG) highfs << 32 | lowfs, + return fstat_helper (buf, ft, ft, ft, ft, 0, (ULONGLONG) highfs << 32 | lowfs, -1LL, 0ULL, 1, DWORD (pc)); } @@ -291,6 +292,7 @@ fhandler_base::fstat_by_name (struct __stat64 *buf) local.ftLastWriteTime, /* see fstat_helper comment */ local.ftLastAccessTime, local.ftLastWriteTime, + local.ftCreationTime, pc.volser (), (ULONGLONG) local.nFileSizeHigh << 32 | local.nFileSizeLow, @@ -302,8 +304,8 @@ fhandler_base::fstat_by_name (struct __stat64 *buf) else if (pc.isdir ()) { FILETIME ft = {}; - res = fstat_helper (buf, ft, ft, ft, pc.volser (), 0ULL, -1LL, 0ULL, 1, - FILE_ATTRIBUTE_DIRECTORY); + res = fstat_helper (buf, ft, ft, ft, ft, pc.volser (), 0ULL, -1LL, 0ULL, + 1, FILE_ATTRIBUTE_DIRECTORY); } else { @@ -379,6 +381,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf, FILETIME ftChangeTime, FILETIME ftLastAccessTime, FILETIME ftLastWriteTime, + FILETIME ftCreationTime, DWORD dwVolumeSerialNumber, ULONGLONG nFileSize, LONGLONG nAllocSize, @@ -392,6 +395,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf, to_timestruc_t (&ftLastAccessTime, &buf->st_atim); to_timestruc_t (&ftLastWriteTime, &buf->st_mtim); to_timestruc_t (&ftChangeTime, &buf->st_ctim); + to_timestruc_t (&ftCreationTime, &buf->st_birthtim); buf->st_dev = dwVolumeSerialNumber ?: pc.volser (); buf->st_size = (_off64_t) nFileSize; /* The number of links to a directory includes the diff --git a/winsup/cygwin/fhandler_mailslot.cc b/winsup/cygwin/fhandler_mailslot.cc index 0748a4807..543c7f806 100644 --- a/winsup/cygwin/fhandler_mailslot.cc +++ b/winsup/cygwin/fhandler_mailslot.cc @@ -44,7 +44,7 @@ fhandler_mailslot::fstat (struct __stat64 *buf) buf->st_nlink = 1; buf->st_blksize = PREFERRED_IO_BLKSIZE; time_as_timestruc_t (&buf->st_ctim); - buf->st_atim = buf->st_mtim = buf->st_ctim; + buf->st_atim = buf->st_mtim = buf->st_birthtim = buf->st_ctim; } return 0; } diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 4da413b7e..1abb99dfd 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -161,8 +161,9 @@ fhandler_process::fstat (struct __stat64 *buf) return -1; case 1: case 2: - buf->st_ctime = buf->st_mtime = p->start_time; - buf->st_ctim.tv_nsec = buf->st_mtim.tv_nsec = 0; + buf->st_ctime = buf->st_mtime = buf->st_birthtime = p->start_time; + buf->st_ctim.tv_nsec = buf->st_mtim.tv_nsec + = buf->st_birthtim.tv_nsec = 0; time_as_timestruc_t (&buf->st_atim); buf->st_uid = p->uid; buf->st_gid = p->gid; diff --git a/winsup/cygwin/fhandler_raw.cc b/winsup/cygwin/fhandler_raw.cc index 13c8fa241..e59b40484 100644 --- a/winsup/cygwin/fhandler_raw.cc +++ b/winsup/cygwin/fhandler_raw.cc @@ -57,7 +57,7 @@ fhandler_dev_raw::fstat (struct __stat64 *buf) buf->st_nlink = 1; buf->st_blksize = PREFERRED_IO_BLKSIZE; time_as_timestruc_t (&buf->st_ctim); - buf->st_atim = buf->st_mtim = buf->st_ctim; + buf->st_atim = buf->st_mtim = buf->st_birthtim = buf->st_ctim; } return 0; } diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index 26e975069..62cd8f454 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -248,7 +248,7 @@ fhandler_registry::fstat (struct __stat64 *buf) &ftLastWriteTime)) { to_timestruc_t (&ftLastWriteTime, &buf->st_mtim); - buf->st_ctim = buf->st_mtim; + buf->st_ctim = buf->st_birthtim = buf->st_mtim; time_as_timestruc_t (&buf->st_atim); if (file_type > 0) buf->st_nlink = subkey_count + 2; diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cygwin/stat.h index 2ae7709c2..3fb011b05 100644 --- a/winsup/cygwin/include/cygwin/stat.h +++ b/winsup/cygwin/include/cygwin/stat.h @@ -1,6 +1,6 @@ /* cygwin/stat.h - Copyright 2002 Red Hat Inc. + Copyright 2002, 2007 Red Hat Inc. Written by Corinna Vinschen <corinna@vinschen.de> This file is part of Cygwin. @@ -50,7 +50,7 @@ struct __stat64 timestruc_t st_ctim; blksize_t st_blksize; __blkcnt64_t st_blocks; - long st_spare4[2]; + timestruc_t st_birthtim; }; extern int fstat64 (int fd, struct __stat64 *buf); @@ -74,12 +74,19 @@ struct stat timestruc_t st_ctim; blksize_t st_blksize; blkcnt_t st_blocks; +#ifdef __CYGWIN_USE_BIG_TYPES__ + timestruc_t st_birthtim; +#else long st_spare4[2]; +#endif }; #define st_atime st_atim.tv_sec #define st_mtime st_mtim.tv_sec #define st_ctime st_ctim.tv_sec +#ifdef __CYGWIN_USE_BIG_TYPES__ +#define st_birthtime st_birthtim.tv_sec +#endif #ifdef __cplusplus } diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 33e5ac972..90f1bce00 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -306,12 +306,13 @@ details. */ 165: Export mq_close, mq_getattr, mq_notify, mq_open, mq_receive, mq_send, mq_setattr, mq_timedreceive, mq_timedsend, mq_unlink. 166: Export sem_unlink. + 167: Add st_birthtim to struct stat. */ /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */ #define CYGWIN_VERSION_API_MAJOR 0 -#define CYGWIN_VERSION_API_MINOR 166 +#define CYGWIN_VERSION_API_MINOR 167 /* There is also a compatibity version number associated with the shared memory regions. It is incremented when incompatible |