commit 266ed58ec091fa7f290d736d0b9b6605f644bdae
parent 6390e11472e2393e4b26bf2e81c2d762546187b0
Author: Drew DeVault <sir@cmpwn.com>
Date: Sat, 28 Jan 2023 17:07:39 +0100
rt: add ftruncate wrapper
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/rt/+linux/syscalls.ha b/rt/+linux/syscalls.ha
@@ -326,6 +326,10 @@ export fn lseek(fd: int, off: i64, whence: int) (i64 | errno) = {
fd: u64, off: u64, whence: u64))?: i64;
};
+export fn ftruncate(fd: int, ln: off_t) (void | errno) = {
+ wrap_return(syscall2(SYS_ftruncate, fd: u64, ln: u32))?;
+};
+
fn faccessat1(dirfd: int, path: *const char, mode: int) (bool | errno) = {
return match (wrap_return(syscall3(SYS_faccessat, dirfd: u64,
path: uintptr: u64, mode: u64))) {