Truncates a file.
Item | Description |
---|---|
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 vnop_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 vnop_ftrunc entry point can be called from the process environment only.
Item | Description |
---|---|
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.