[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

vn_rename Entry Point

Purpose

Renames a file or directory.

Syntax

int vn_rename (srcvp, srcdvp, oldname, destvp, destdvp, newname, crp)
struct vnode *srcvp;
struct vnode *srcdvp;
char *oldname;
struct vnode *destvp;
struct vnode *destdvp;
char *newname;
struct ucred *crp;

Parameters

srcvp Points to the virtual node (v-node) of the object to rename.
srcdvp Points to the v-node of the directory where the srcvp parameter resides. The parent directory for the old and new object can be the same.
oldname Identifies the old name of the object.
destvp Points to the v-node of the new object. This pointer is used only if the new object exists. Otherwise, this parameter is the null character.
destdvp Points to the parent directory of the new object. The parent directory for the new and old objects can be the same.
newname Points to the new name of the object.
crp Points to the cred structure. This structure contains data that applications can use to validate access permission.

Description

The vn_rename entry point is invoked by the logical file system to rename a file or directory. This entry point provides the following renaming actions:

To ensure that this entry point routine executes correctly, the logical file system guarantees the following:

Execution Environment

The vn_rename entry point can be called from the process environment only.

Return Values

0 Indicates success.

Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.

Related Information

The rename subroutine.

Virtual File System Overview, Virtual File System Kernel Extensions Overview, Logical File System Overview, Understanding Virtual Nodes (V-nodes) in AIX Kernel Extensions and Device Support Programming Concepts.

List of Virtual File System Operations.


[ Previous | Next | Contents | Home | Search ]