From 2292b11e82a3d6d70e7bb932c512155dc13c5025 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Tue, 24 Oct 2023 14:10:07 +0200 Subject: VFS/LibC: Create ftruncate function and corresponding syscall and libc implementation Previously this function was only used for shared memory region created by shm_open because I was lazy. Now exists for all files. --- userland/libc/unistd/ftruncate.c | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 userland/libc/unistd/ftruncate.c (limited to 'userland/libc/unistd') diff --git a/userland/libc/unistd/ftruncate.c b/userland/libc/unistd/ftruncate.c new file mode 100644 index 0000000..cf35944 --- /dev/null +++ b/userland/libc/unistd/ftruncate.c @@ -0,0 +1,6 @@ +#include +#include + +int ftruncate(int fildes, size_t length) { + RC_ERRNO(syscall(SYS_FTRUNCATE, fildes, length, 0, 0, 0)); +} -- cgit v1.2.3