AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
trunc.c File Reference

The generic truncate operation for files that are vnodes. More...

#include <core/system.h>
#include <fs/vfs.h>
#include <fs/posix.h>

Go to the source code of this file.

Functions

int posix_file_trunc (struct file *file, off_t len)
 Truncates (or extends) an open file to a new length.

Detailed Description

The generic truncate operation for files that are vnodes.

Definition in file trunc.c.

Function Documentation

◆ posix_file_trunc()

int posix_file_trunc ( struct file * file,
off_t len )

Truncates (or extends) an open file to a new length.

Parameters
filethe open file
lenthe new length, in bytes
Returns
0, or a negative errno

Definition at line 16 of file trunc.c.

References posix_file_trunc(), and vfs_trunc().

Referenced by posix_file_trunc().