Back to index

glibc  2.9
utimes.c File Reference
#include <errno.h>
#include <stddef.h>
#include <utime.h>
#include <sys/time.h>
#include <sysdep.h>
#include <kernel-features.h>

Go to the source code of this file.


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

Function Documentation

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

Definition at line 30 of file utimes.c.

#ifdef __NR_utimes
  int result = INLINE_SYSCALL (utimes, 2, file, tvp);
# ifndef __ASSUME_UTIMES
  if (result != -1 || errno != ENOSYS)
# endif
    return result;

  /* The utimes() syscall does not exist or is not available in the
     used kernel.  Use utime().  For this we have to convert to the
     data format utime() expects.  */
  struct utimbuf buf;
  struct utimbuf *times;

  if (tvp != NULL)
      times = &buf;
      buf.actime = tvp[0].tv_sec + tvp[0].tv_usec / 1000000;
      buf.modtime = tvp[1].tv_sec + tvp[1].tv_usec / 1000000;
    times = NULL;

  return INLINE_SYSCALL (utime, 2, file, times);

Here is the call graph for this function: