From 372c633aa22d826bc515213ad4211791440f60f8 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Thu, 3 Oct 2024 16:08:46 +0200 Subject: libc: Add sendfile and queue --- userland/libc/sys/sendfile.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 userland/libc/sys/sendfile.c (limited to 'userland/libc/sys/sendfile.c') diff --git a/userland/libc/sys/sendfile.c b/userland/libc/sys/sendfile.c new file mode 100644 index 0000000..818883b --- /dev/null +++ b/userland/libc/sys/sendfile.c @@ -0,0 +1,12 @@ +#include +#include +#include + +u32 sendfile(int out_fd, int in_fd, off_t *offset, size_t count, + int *error_rc) { + u32 r = syscall(SYS_SENDFILE, out_fd, in_fd, offset, count, error_rc); + if (error_rc) { + errno = -1 * *error_rc; + } + return r; +} -- cgit v1.2.3