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

vn_ftrunc Entry Point

Purpose

Truncates a file.

Syntax

int vn_ftrunc (vp, flags, length, vinfo, crp)
struct vnode *vp;
int flags;
offset_t length;
caddr_t vinfo;
struct ucred *crp;

Parameters

vp Points to the virtual node (v-node) of the file.
flags Identifies flags from the open file structure.
length Specifies the length to which the file should be truncated.
vinfo This parameter is unused.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Description

The vn_ftrunc entry point is invoked by the logical file system to decrease the length of a file by truncating it. This operation is unsuccessful if any process other than the caller has locked a portion of the file past the specified offset.

Execution Environment

The vn_ftrunc 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 ftruncate 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 ]