test veritas logo



vxfs_nattr_utimes - set access and modification times for named data streams


cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldl

#include <sys/time.h>

int vxfs_nattr_utimes(int sfd, constr char *path, const struct timeval times[2]);


The vxfs_nattr_utimes() function sets the access and modification times of the named data stream pointed to by the path argument for the file descriptor fd to the value of the times argument. The times argument is an array of two timeval structures. The first array member represents the date and time of last access, and the second member represents the date and time of last modification. The times argument in the timeval structure is measured in seconds and microseconds since the Epoch, and rounding off toward the nearest second may occur.

If the times argument is NULL, the access and modification times of the file are set to the current time. The process should have write access to the file or the appropriate special privileges, or the effective UID of the process should be same as the owner of the file to be used.

If the vxfs_nattr_utimes() call is successful, the ctime field for the named data stream will change.


vxfs_nattr_utimes() returns zero on success. Otherwise, -1 is returned and errno is set to indicate an error, and the file times will not be affected.


EACCES Search permission is denied by a component of the path prefix; or the times argument is a null pointer and the effective user ID of the process does not match the owner of the file and write access is denied.
EFAULT The path or times argument points to an illegal address.
EINTR A signal was caught during the execution of the vxfs_nattr_utimes() function.
EINVAL The number of microseconds specified in one or both of the timeval structures pointed to by times was greater than or equal to 1,000,000 or less than 0.
EIO An I/O error occurred while reading from or writing to the file system.
ELOOP Too many symbolic links were encountered in resolving path.
ENAMETOOLONG The length of the path argument exceeds PATH_MAX or a pathname component is longer than NAME_MAX.
ENOLINK The path argument points to a remote machine with a link that is no longer active.
ENOENT A component of path does not name an existing file or path is an empty string.
ENOTDIR A component of the path prefix is not a directory.
EPERM The times argument is not a null pointer and the calling process’ effective user ID has write access to the file but does not match the owner of the file, and the calling process does not have the appropriate privileges.
EROFS The file system containing the file is read-only.


vxfs_nattr_link(3), vxfs_nattr_open(3), vxfs_nattr_unlink(3) vxfs_nattr_rename(3)

VxFS 8.0 vxfs_nattr_utimes(3)