BSD 4_3_Tahoe release
[unix-history] / usr / src / man / man2 / utimes.2
CommitLineData
14d9e8bc
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
ca67e7b4 5.\" @(#)utimes.2 6.5 (Berkeley) 9/30/87
14d9e8bc 6.\"
ca67e7b4 7.TH UTIMES 2 "September 30, 1987"
14d9e8bc
KM
8.UC 4
9.SH NAME
481ecf6a 10utimes \- set file times
14d9e8bc
KM
11.SH SYNOPSIS
12.nf
481ecf6a
KM
13.ft B
14#include <sys/time.h>
14d9e8bc 15.PP
481ecf6a
KM
16.ft B
17utimes(file, tvp)
18char *file;
d35d0f14 19struct timeval tvp[2];
14d9e8bc
KM
20.fi
21.SH DESCRIPTION
22The
481ecf6a 23.I utimes
14d9e8bc
KM
24call
25uses the
481ecf6a 26\*(lqaccessed\*(rq and \*(lqupdated\*(rq times in that order
14d9e8bc 27from the
481ecf6a 28.I tvp
14d9e8bc
KM
29vector
30to set the corresponding recorded times for
31.I file.
32.PP
33The caller must be the owner of the file or the super-user.
481ecf6a
KM
34The \*(lqinode-changed\*(rq time of the file is set to the current time.
35.SH "RETURN VALUE
36Upon successful completion, a value of 0 is returned.
37Otherwise, a value of \-1 is returned and
38.I errno
39is set to indicate the error.
40.SH "ERRORS
9b0a1008 41.I Utimes
481ecf6a
KM
42will fail if one or more of the following are true:
43.TP 15
b5984ffe
KM
44[ENOTDIR]
45A component of the path prefix is not a directory.
481ecf6a 46.TP 15
b5984ffe
KM
47[EINVAL]
48The pathname contains a character with the high-order bit set.
49.TP 15
50[ENAMETOOLONG]
51A component of a pathname exceeded 255 characters,
52or an entire path name exceeded 1023 characters.
481ecf6a
KM
53.TP 15
54[ENOENT]
55The named file does not exist.
56.TP 15
b5984ffe
KM
57[ELOOP]
58Too many symbolic links were encountered in translating the pathname.
481ecf6a
KM
59.TP 15
60[EPERM]
61The process is not super-user and not the owner of the file.
62.TP 15
63[EACCES]
b5984ffe
KM
64Search permission is denied for a component of the path prefix.
65.TP 15
481ecf6a
KM
66[EROFS]
67The file system containing the file is mounted read-only.
68.TP 15
69[EFAULT]
fd690c8b
KM
70.I File
71or \fItvp\fP points outside the process's allocated address space.
72.TP 15
73[EIO]
74An I/O error occurred while reading or writing the affected inode.
14d9e8bc 75.SH SEE ALSO
481ecf6a 76stat(2)