utimensat(3)

DESCRIPTION

Updates path's modification time to the current kernel realtime. Only AT_FDCWD (-100) and flags equal to zero are accepted; times is ignored.

SYNOPSIS

#include <sys/stat.h>

int utimensat(int dirfd, const char *path, const struct timespec times[2], int flags);

RETURN VALUE

  • Returns zero, or -1 and sets errno.

ERRORS

  • -EINVAL
    • Dirfd is not AT_FDCWD, flags is nonzero, or path resolution fails.
  • -EFAULT
    • Path cannot be read.
  • -ENOENT
    • The path does not exist.
  • -EROFS
    • The filesystem does not support timestamp updates.

NOTES

This is a restricted native implementation, not a general dirfd-relative or caller-specified timestamp operation.