Back to index

glibc  2.9
Functions
lutimes.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <time.h>
#include <sys/time.h>
#include <sysdep.h>
#include <kernel-features.h>
#include <stub-tag.h>

Go to the source code of this file.

Functions

int lutimes (const char *file, const struct timeval tvp[2])

Function Documentation

int lutimes ( const char *  file,
const struct timeval  tvp[2] 
)

Definition at line 30 of file lutimes.c.

{
#ifdef __NR_utimensat
  /* The system call espects timespec, not timeval.  */
  struct timespec ts[2];
  if (tvp != NULL)
    {
      if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000
          || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000)
       {
         __set_errno (EINVAL);
         return -1;
       }

      TIMEVAL_TO_TIMESPEC (&tvp[0], &ts[0]);
      TIMEVAL_TO_TIMESPEC (&tvp[1], &ts[1]);
    }

  return INLINE_SYSCALL (utimensat, 4, AT_FDCWD, file, tvp ? ts : NULL,
                      AT_SYMLINK_NOFOLLOW);
#else
  __set_errno (ENOSYS);
  return -1;
#endif
}

Here is the call graph for this function: