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

vn_getattr Entry Point

Purpose

Gets the attributes of a file.

Syntax

int vn_getattr (vp, vap, crp)
struct vnode *vp;
struct vattr *vap;
struct ucred *crp;

Parameters

vp Specifies the virtual node (v-node) of the file system object.
vap Points to a vattr structure.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vn_getattr entry point is called by the logical file system to retrieve information about a file. The vattr structure indicated by the vap parameter contains all the relevant attributes of the file. The vattr structure is defined in the /usr/include/sys/vattr.h file. This entry point is used to implement the stat, fstat, and lstat subroutines.

Note: The indicated v-node is held for the duration of the vn_getattr subroutine.

Execution Environment

The vn_getattr 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 statx 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.


[ Previous | Next | Contents | Home | Search ]