UTIMES(2) System Calls Manual UTIMES(2)
utimes - set file times
int utimes(file, tvp)
struct timeval *tvp;
utimes() sets the access and modification times of the file named by
If tvp is NULL, the access and modification times are set to the cur-
rent time. A process must be the owner of the file or have write per-
mission for the file to use utimes() in this manner.
If tvp is not NULL, it is assumed to point to an array of two timeval
structures. The access time is set to the value of the first member,
and the modification time is set to the value of the second member.
Only the owner of the file or the super-user may use utimes() in this
In either case, the inode-changed time of the file is set to the cur-
0 on success.
-1 on failure and sets errno to indicate the error.
EACCES Search permission is denied for a component of the path
prefix of file.
EACCES The effective user ID of the process is not super-user
and not the owner of the file, write permission is
denied for the file, and tvp is NULL.
EFAULT file or tvp points outside the process's allocated
EIO An I/O error occurred while reading from or writing to
the file system.
ELOOP Too many symbolic links were encountered in translating
ENOENT The file referred to by file does not exist.
ENOTDIR A component of the path prefix of file is not a direc-
EPERM The effective user ID of the process is not super-user
and not the owner of the file, and tvp is not NULL.
EROFS The file system containing the file is mounted read-
21 January 1990 UTIMES(2)