UTIME(2-POSIX) RISC/os Reference Manual UTIME(2-POSIX)
NAME
utime - set file access and modification times
SYNOPSIS
#include <sys/types.h>
#include <utime.h>
int utime (path, times)
char *path;
struct utimbuf *times;
DESCRIPTION
path points to a pathname naming a file. utime sets the
access and modification times of the named file.
If times is NULL, the access and modification times of the
file are set to the current time. The effective user ID of
the process must match the owner of the file, or the process
must have write permission for the file or be the superuser,
to use utime in this manner.
If times is not NULL, it is interpreted as a pointer to a
utimbuf structure and the access and modification times are
set to the values contained in the designated structure.
Only the owner of the file and processes that are the
superuser are permitted to use utime in this way.
The utimbuf structure is defined in <utime.h> and includes
the following:
time_t actime /* access time */
time_t modtime /* modification time */
The times in the utimbuf structure are measured in seconds
since the Epoch (00:00:00 GMT, January 1, 1970).
Upon successful completion, utime marks for update the
st_ctime field of the file.
ERRORS
utime will fail if one or more of the following are true:
[ENOENT] The named file does not exist, or path
points to an empty string.
[ENOTDIR] A component of the path prefix is not a
directory.
[EPERM] The effective user ID is not super-user
and not the owner of the file and times
is not NULL.
Printed 1/15/91 Page 1
UTIME(2-POSIX) RISC/os Reference Manual UTIME(2-POSIX)
[EACCES] Search permission is denied by a com-
ponent of the path prefix, or the effec-
tive user ID is not super-user and not
the owner of the file and times is NULL
and write access is denied.
[ENAMETOOLONG] The length of path exceeds {PATH_MAX},
or a pathname component is longer than
{NAME_MAX} while {_POSIX_NO_TRUNC} is in
effect.
[EROFS] The file system containing the file is
mounted read-only.
[EFAULT] times is not NULL and points outside the
process's allocated address space.
[EFAULT] path points outside the process's allo-
cated address space.
[EINTR] A signal was caught during the utime
system call.
SEE ALSO
stat(2).
DIAGNOSTICS
Upon successful completion, a value of 0 is returned. Oth-
erwise, a value of -1 is returned and errno is set to indi-
cate the error.
Page 2 Printed 1/15/91