Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-06-06 19:35:09 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-06-06 19:35:09 +0400
commitc4e6ff484c1e6a57304d14ba46852054e98e9158 (patch)
tree2d881cc668e649009946693521b0a9f097dd6060 /winsup/cygwin/include
parenta81cc3be2ab2a194428a4225709b91366511f1f8 (diff)
* fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of
st_atim, st_mtim, and st_ctim fields. * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto. * fhandler_process.cc (fhandler_process::fstat): Ditto. * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and st_ctim fields. * syscalls.cc (stat64_to_stat32): Ditto. * times.cc (to_timestruc_t): New function. (time_as_timestruc_t): New function. * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions. * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for all file times, removing the st_spare1, st_spare2, and st_spare3 fields in the process. Add macros to access tv_sec fields by old names. * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct timespec.
Diffstat (limited to 'winsup/cygwin/include')
-rw-r--r--winsup/cygwin/include/cygwin/stat.h31
-rw-r--r--winsup/cygwin/include/cygwin/types.h2
2 files changed, 15 insertions, 18 deletions
diff --git a/winsup/cygwin/include/cygwin/stat.h b/winsup/cygwin/include/cygwin/stat.h
index 0ac22a679..5772a3754 100644
--- a/winsup/cygwin/include/cygwin/stat.h
+++ b/winsup/cygwin/include/cygwin/stat.h
@@ -27,12 +27,9 @@ struct __stat32
__gid16_t st_gid;
__dev16_t st_rdev;
__off32_t st_size;
- time_t st_atime;
- long st_spare1;
- time_t st_mtime;
- long st_spare2;
- time_t st_ctime;
- long st_spare3;
+ timestruc_t st_atim;
+ timestruc_t st_mtim;
+ timestruc_t st_ctim;
blksize_t st_blksize;
__blkcnt32_t st_blocks;
long st_spare4[2];
@@ -48,12 +45,9 @@ struct __stat64
__gid32_t st_gid;
__dev32_t st_rdev;
__off64_t st_size;
- time_t st_atime;
- long st_spare1;
- time_t st_mtime;
- long st_spare2;
- time_t st_ctime;
- long st_spare3;
+ timestruc_t st_atim;
+ timestruc_t st_mtim;
+ timestruc_t st_ctim;
blksize_t st_blksize;
__blkcnt64_t st_blocks;
long st_spare4[2];
@@ -75,17 +69,18 @@ struct stat
gid_t st_gid;
dev_t st_rdev;
off_t st_size;
- time_t st_atime;
- long st_spare1;
- time_t st_mtime;
- long st_spare2;
- time_t st_ctime;
- long st_spare3;
+ timestruc_t st_atim;
+ timestruc_t st_mtim;
+ timestruc_t st_ctim;
blksize_t st_blksize;
blkcnt_t st_blocks;
long st_spare4[2];
};
+#define st_atime st_atim.tv_sec
+#define st_mtime st_mtim.tv_sec
+#define st_ctime st_ctim.tv_sec
+
#ifdef __cplusplus
}
#endif
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index 8f9f16105..69bfa2056 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -19,6 +19,8 @@ extern "C"
#include <sys/sysmacros.h>
+typedef struct timespec timespec_t, timestruc_t;
+
typedef long __off32_t;
typedef long long __off64_t;
#ifdef __CYGWIN_USE_BIG_TYPES__