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 | .\" | |
481ecf6a | 5 | .\" @(#)utimes.2 5.1 (Berkeley) %G% |
14d9e8bc | 6 | .\" |
481ecf6a | 7 | .TH UTIMES 2 "2 July 1983" |
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; | |
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 | |
41 | .I Utime | |
42 | will fail if one or more of the following are true: | |
43 | .TP 15 | |
44 | [EPERM] | |
45 | The pathname contained a character with the high-order bit set. | |
46 | .TP 15 | |
47 | [ENOENT] | |
48 | The pathname was too long. | |
49 | .TP 15 | |
50 | [ENOENT] | |
51 | The named file does not exist. | |
52 | .TP 15 | |
53 | [ENOTDIR] | |
54 | A component of the path prefix is not a directory. | |
55 | .TP 15 | |
56 | [EACCES] | |
57 | A component of the path prefix denies search permission. | |
58 | .TP 15 | |
59 | [EPERM] | |
60 | The process is not super-user and not the owner of the file. | |
61 | .TP 15 | |
62 | [EACCES] | |
63 | The effective user ID is not super-user and not the | |
64 | owner of the file and \fItimes\fP is NULL and write access | |
65 | is denied. | |
66 | .TP 15 | |
67 | [EROFS] | |
68 | The file system containing the file is mounted read-only. | |
69 | .TP 15 | |
70 | [EFAULT] | |
71 | .I Tvp | |
72 | points outside the process's allocated address space. | |
73 | .TP 15 | |
74 | [ELOOP] | |
75 | Too many symbolic links were encountered in translating the pathname. | |
14d9e8bc | 76 | .SH SEE ALSO |
481ecf6a | 77 | stat(2) |