int vn_ftrunc (vp, flags, length, vinfo, crp) struct vnode *vp; int flags; offset_t length; caddr_t vinfo; struct ucred *crp;
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. |
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.
The vn_ftrunc entry point can be called from the process environment only.
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.
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.