Symantec logo

vxfs_nattr_rename

NAME

vxfs_nattr_rename - rename a named data stream.

SYNOPSIS

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

#include <sys/types.h>

#include <vxfsutil.h>

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

DESCRIPTION

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.

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)