Home > Veritas Storage Foundation™ File System Manual Pages

VXFS_NATTR_RENAME (3)

Library Functions

Table of contents


NAME

vxfs_nattr_rename - rename a named data stream.

SYNOPSIS

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

#include <sys/types.h>

#include <vxfsutil.h>

int vxfs_nattr_rename(int sfd, char *old, char *tnew);


DESCRIPTION

The vxfs_nattr_rename() function changes the name space entry pointed to the attribute new of the file sfd from the attribute old. of the file sfd. old and new are resolved relative to the vnode pointed to by sfd.

If the link named by new exists, the link count of the file becomes zero when the file is removed and no process has the file open. The space occupied by the file is freed and the file is no longer accessible. If one or more processes have the file open when the last link is removed, the link is removed before vxfs_nattr_rename() returns, but the contents of the file are not removed until all references to the file are closed.

After successful completion, vxfs_nattr_rename() marks the st_ctime and st_mtime fields of the parent directory of each file for update.

Renaming a named data stream to have a prefix of $vxfs: fails with the EINVAL error. The $vxfs: prefix is reserved by VERITAS.


RETURN VALUES

vxfs_nattr_rename() returns zero on success. Otherwise, -1 is returned and errno is set to indicate an error.

ERRORS

EACCES
A component of either path prefix did not have search permission. One of the directories containing old and new did not have write permissions. There was no write permission for a directory pointed to by old or new.
EINVAL
The file system disk layout version does not support named data streams.
EIO
An I/O error occurred while making or updating a directory entry.
ENAMETOOLONG
The length of old or new exceeds PATH_MAX. A path name component is longer than NAME_MAX while _POSIX_NO_TRUNC is in effect.
ENOENT
The link named by old does not exist. Either old or new points to an empty string.
EROFS
The requested operation is a write operation to a directory on a read-only file system.
EXDEV
The links named by old and new are on different file systems.

SEE ALSO

vxfs_nattr_link(3), vxfs_nattr_open(3), vxfs_nattr_unlink(3) vxfs_nattr_utimes(3)

Last updated: 01 April 2006
Copyright ©2009 Symantec Corporation
All rights reserved.