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