vxfs_nattr_rename - rename a named data stream.
cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldld
int vxfs_nattr_rename(int sfd, char *old, char *new);
The vxfs_nattr_rename() function changes the name space entry of the file sfd from the link old to the link new. 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 Symantec.
vxfs_nattr_rename() returns zero on success. Otherwise, -1 is returned and errno is set to indicate an error.
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.
The file system disk layout version does not support named data streams.
An I/O error occurred while making or updating a directory entry.
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.
The link named by old does not exist. Either old or new points to an empty string.
The requested operation is a write operation to a directory on a read-only file system.
The links named by old and new are on different file systems.
vxfs_nattr_link(3), vxfs_nattr_open(3), vxfs_nattr_unlink(3) vxfs_nattr_utimes(3)