Open System Services System Calls Reference Manual (G06.25+, H06.03+)

System Functions (u) utime(2)
NAME
utime - Sets le access and modication times
LIBRARY
G-series native OSS processes: system library
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <utime.h>
int utime(
const char *path,
struct utimbuf *times);
PARAMETERS
path Points to the pathname for the le. If the nal component of the path parameter
names a symbolic link, the link is traversed and pathname resolution continues.
times Points to a utimbuf structure containing time values for the le.
DESCRIPTION
The utime() function sets the access and modication times of the le pointed to by the path
parameter to the value of the times parameter. It allows time specications that are accurate to
the nearest second.
The times parameter is a pointer to a utimbuf structure, which is dened in the utime.h header
le. The actime eld in this structure represents the date and time of last access, and the mod-
time eld represents the date and time of last modication. The times in the utimbuf structure
are measured in seconds since the Epoch, which is 00:00:00, January 1, 1970, Coordinated
Universal Time (UTC).
If the times parameter is a null pointer, the access and modication times of the le are set to the
current time. The effective user ID of the process either must be the same as the owner of the
le, must have write access to the le, or must have appropriate privileges in order to use the call
in this manner.
If the times parameter is not a null pointer, the access and modication times are set to the values
contained in the designated structure. Only the owner of the le or a process with appropriate
privileges can use the call this way.
Upon successful completion, the utime() function marks the time of the last le status change,
st_ctime, for update.
Use on Guardian Objects
The utime() function is supported for Guardian les (that is, les within /G) that are unstructured
Enscribe les. If the utime( ) function is called for a Guardian le that has a small le label, the
label is expanded to include the st_atime and st_ctime elds and to mark them for update.
The utime() function cannot be used on a le in /G that is opened for execution. A call for such
a le fails and errno is set to [ETXTBSY].
527186-003 Hewlett-Packard Company 911