diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-24 09:59:54 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-24 09:59:54 +0000 |
commit | eba32ec829904a40f34808374a1c53415ef7bc0b (patch) | |
tree | 9b345ab8c40ce458d77f73de9a693177a89ccbfa /winsup/cygwin/syscalls.cc | |
parent | 0d02384a4892d1419ca12125beaf155d2af7d720 (diff) | |
download | cygnal-eba32ec829904a40f34808374a1c53415ef7bc0b.tar.gz cygnal-eba32ec829904a40f34808374a1c53415ef7bc0b.tar.bz2 cygnal-eba32ec829904a40f34808374a1c53415ef7bc0b.zip |
* cygwin.din (futimens): Export.
(utimensat): Export.
* fhandler.cc (fhandler_base::utimens): Replace fhandler_base::utimes.
Call utimens_fs.
* fhandler.h (class fhandler_base): Declare utimens_fs instead of
utimes_fs, utimens instead of utimes.
(class fhandler_disk_file): Declare utimens instead of utimes.
* fhandler_disk_file.cc (fhandler_disk_file::utimens): Replace
fhandler_disk_file::utimes.
(fhandler_base::utimens_fs): Replace fhandler_base::utimes_fs.
Implement tv_nsec handling according to SUSv4.
* syscalls.cc (utimensat): New function.
* times.cc (timespec_to_filetime): New function.
(timeval_to_timespec): New function.
(utimens_worker): Replace utimes_worker.
(utimes): Convert timeval to timespec and call utimens_worker.
(lutimes): Ditto.
(futimens): Take over implementation from futimes.
(futimes): Convert timeval to timespec and call futimens.
* winsup.h (timespec_to_filetime): Declare.
* include/cygwin/version.h: Bump API minor number.
* posix.sgml: Add SUSv4 section. Add futimens and utimensat to it.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 1a2572186..7da929efa 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -3631,6 +3631,25 @@ fstatat (int dirfd, const char *pathname, struct __stat64 *st, int flags) return (flags & AT_SYMLINK_NOFOLLOW) ? lstat64 (path, st) : stat64 (path, st); } +extern int utimens_worker (path_conv &, const struct timespec *); + +extern "C" int +utimensat (int dirfd, const char *pathname, const struct timespec *times, + int flags) +{ + myfault efault; + if (efault.faulted (EFAULT)) + return -1; + tmp_pathbuf tp; + char *path = tp.c_get (); + if (gen_full_path_at (path, dirfd, pathname)) + return -1; + path_conv win32 (path, PC_POSIX | ((flags & AT_SYMLINK_NOFOLLOW) + ? PC_SYM_NOFOLLOW : PC_SYM_FOLLOW), + stat_suffixes); + return utimens_worker (win32, times); +} + extern "C" int futimesat (int dirfd, const char *pathname, const struct timeval *times) { |