The access and modification times of the file named by
or referenced by
are changed as specified by the argument
The inode-change-time of the file is set to the current time.
specifies a relative path,
it is relative to the current working directory if
and otherwise relative to the directory associated with the file descriptor
field of a
can be set to the special value
to set the current time, or to
to leave the time unchanged.
In either case, the
field is ignored.
it is assumed to point to an array of two timespec structures.
The access time is set to the value of the first element, and the
modification time is set to the value of the second element.
For file systems that support file birth (creation) times (such as
the birth time will be set to the value of the second element
if the second element is older than the currently set birth time.
To set both a birth time and a modification time,
two calls are required; the first to set the birth time
and the second to set the (presumably newer) modification time.
Ideally a new system call will be added that allows the setting
of all three times at once.
this is equivalent to passing
a pointer to an array of two timespec structures
fields set to
the timestamps remain unchanged and
no permissions are needed for the file itself,
although search permissions may be required for the path prefix.
The call may or may not succeed if the named file does not exist.
the caller must be the owner of the file, have permission to
write the file, or be the super-user.
For all other values of the timestamps,
the caller must be the owner of the file or be the super-user.
The values for the
argument of the
are constructed by a bitwise-inclusive OR of flags from the following list,
.In fcntl.h :
names a symbolic link, the symbolic links times are changed.
changes the times of the file referenced by the symbolic link.