Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

System Functions (u) utime(2)
NAME
utime - Sets file access and modification times
LIBRARY
G-series native OSS processes: system library
H-series and J-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 file. If the final 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 file.
DESCRIPTION
The utime() function sets the access and modification times of the file pointed to by the path
parameter to the value of the times parameter. It allows time specifications that are accurate to
the nearest second.
The times parameter is a pointer to a utimbuf structure, which is defined in the utime.h header
file. The actime field in this structure represents the date and time of last access, and the mod-
time field represents the date and time of last modification. 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 modification times of the file are set to the
current time. The effective user ID of the process either must be the same as the owner of the
file, must have write access to the file, 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 modification times are set to the values
contained in the designated structure. Only the owner of the file or a process with appropriate
privileges can use the call this way.
Upon successful completion, the utime( ) function marks the time of the last file status change,
st_ctime, for update.
Accessing Files in Restricted-Access Filesets
When accessing a file in a restricted-access leset, the super ID (255,255 in the Guardian
environment, 65535 in the OSS environment) is restricted by the same file permissions and
owner privileges as any other user ID: It has no special privileges unless the executable file
started by the super ID has the PRIVSETID file privilege. In this case, the process started by the
super ID can switch to another ID and then access les in restricted-access lesets as that ID.
Executable files that have the PRIVSOARFOPEN privilege and that are started by a member of
the Safeguard SECURITY-OSS-ADMINISTRATOR (SOA) group have the appropriate privilege
to use this function on any file in a restricted-access leset. However, Network File System
(NFS) clients are not granted SOA group privileges, even if these clients are accessing the sys-
tem with a user ID that is a member of the SOA security group.
For more information about restricted-access lesets and file privileges, see the Open System Ser-
vices Management and Operations Guide.
527186-023 Hewlett-Packard Company 911