diff options
author | Christopher Haster <chaster@utexas.edu> | 2018-01-21 02:30:40 +0300 |
---|---|---|
committer | Christopher Haster <chaster@utexas.edu> | 2018-01-21 04:22:44 +0300 |
commit | d88f0ac02ff93b549418d38d464b5591fce4f688 (patch) | |
tree | a10fb4ed3bbcaed8d24180a04532c20c15a24fc7 /lfs.h | |
parent | 2ad435ed6309096979d6f90aa762632d23202a42 (diff) |
Added lfs_file_truncate
As a copy-on-write filesystem, the truncate function is a very nice
function to have, as it can take advantage of reusing the data already
written out to disk.
Diffstat (limited to 'lfs.h')
-rw-r--r-- | lfs.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -364,6 +364,11 @@ lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file, lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file, lfs_soff_t off, int whence); +// Truncates the size of the file to the specified size +// +// Returns a negative error code on failure. +int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size); + // Return the position of the file // // Equivalent to lfs_file_seek(lfs, file, 0, LFS_SEEK_CUR) |