source: trunk/minix/man/man2/utime.2@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 1.9 KB
Line 
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.\"
5.\" @(#)utimes.2 6.4 (Berkeley) 8/26/85
6.\"
7.TH UTIME 2 "August 26, 1985"
8.UC 4
9.SH NAME
10utime \- set file times
11.SH SYNOPSIS
12.nf
13.ft B
14#include <sys/types.h>
15#include <utime.h>
16
17int utime(const char *\fIfile\fP, struct utimbuf *\fItimes\fP)
18.fi
19.SH DESCRIPTION
20The
21.B utime
22call
23uses the
24\*(lqaccessed\*(rq and \*(lqupdated\*(rq times
25from the utimbuf structure pointed to by
26.I times
27to set the corresponding recorded times for
28.I file.
29.PP
30Struct utimbuf is defined in <utime.h> as follows:
31.PP
32.RS
33.nf
34.ta +0.4i +0.8i +1.0i
35struct utimbuf {
36 time_t actime; /* access time */
37 time_t modtime; /* modification time */
38};
39.fi
40.RE
41.PP
42The caller must be the owner of the file or the super-user.
43The \*(lqinode-changed\*(rq time of the file is set to the current time.
44.SH "RETURN VALUE
45Upon successful completion, a value of 0 is returned.
46Otherwise, a value of \-1 is returned and
47.B errno
48is set to indicate the error.
49.SH "ERRORS
50.B Utime
51will fail if one or more of the following are true:
52.TP 15
53[ENOTDIR]
54A component of the path prefix is not a directory.
55.TP 15
56[EINVAL]
57The pathname contains a character with the high-order bit set.
58.TP 15
59[ENAMETOOLONG]
60The path name exceeds PATH_MAX characters.
61.TP 15
62[ENOENT]
63The named file does not exist.
64.TP 15
65[ELOOP]
66Too many symbolic links were encountered in translating the pathname.
67(Minix-vmd)
68.TP 15
69[EPERM]
70The process is not super-user and not the owner of the file.
71.TP 15
72[EACCES]
73Search permission is denied for a component of the path prefix.
74.TP 15
75[EROFS]
76The file system containing the file is mounted read-only.
77.TP 15
78[EFAULT]
79.I File
80or \fItimes\fP points outside the process's allocated address space.
81.TP 15
82[EIO]
83An I/O error occurred while reading or writing the affected inode.
84.SH SEE ALSO
85.BR stat (2).
Note: See TracBrowser for help on using the repository browser.