Return 0 on success, -1 (setting errno) on failure. */
int
-fdutimens (char const *file, int fd, struct timespec const timespec[2])
+fdutimens (int fd, char const *file, struct timespec const timespec[2])
{
struct timespec adjusted_timespec[2];
struct timespec *ts = timespec ? adjusted_timespec : NULL;
{
#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
struct timeval timeval[2];
- struct timeval const *t;
+ struct timeval *t;
if (ts)
{
timeval[0].tv_sec = ts[0].tv_sec;
}
}
-/* Set the access and modification time stamps of FD (a.k.a. FILE) to be
- TIMESPEC[0] and TIMESPEC[1], respectively.
- FD must be either negative -- in which case it is ignored --
- or a file descriptor that is open on FILE.
- If FD is nonnegative, then FILE can be NULL, which means
- use just futimes (or equivalent) instead of utimes (or equivalent),
- and fail if on an old system without futimes (or equivalent).
- If TIMESPEC is null, set the time stamps to the current time.
- Return 0 on success, -1 (setting errno) on failure. */
-
-int
-gl_futimens (int fd, char const *file, struct timespec const timespec[2])
-{
- return fdutimens (file, fd, timespec);
-}
-
/* Set the access and modification time stamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively. */
int
utimens (char const *file, struct timespec const timespec[2])
{
- return fdutimens (file, -1, timespec);
+ return fdutimens (-1, file, timespec);
}
/* Set the access and modification time stamps of FILE to be
/* The Linux kernel did not support symlink timestamps until
utimensat, in version 2.6.22, so we don't need to mimic
- gl_futimens' worry about buggy NFS clients. But we do have to
+ fdutimens' worry about buggy NFS clients. But we do have to
worry about bogus return values. */
#if HAVE_UTIMENSAT
#if HAVE_LUTIMES && !HAVE_UTIMENSAT
{
struct timeval timeval[2];
- struct timeval const *t;
+ struct timeval *t;
int result;
if (ts)
{
if (!(adjustment_needed || REPLACE_FUNC_STAT_FILE) && lstat (file, &st))
return -1;
if (!S_ISLNK (st.st_mode))
- return fdutimens (file, -1, ts);
+ return fdutimens (-1, file, ts);
errno = ENOSYS;
return -1;
}