summaryrefslogtreecommitdiff
path: root/userland/libc/sys/sendfile.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-10-03 16:08:46 +0200
committerAnton Kling <anton@kling.gg>2024-10-03 16:09:12 +0200
commit372c633aa22d826bc515213ad4211791440f60f8 (patch)
treeb2de66c9bf612a0a149c65786335a6cebde37840 /userland/libc/sys/sendfile.c
parent226d861c9ebb7f09f95665d07d9ab5c6b7ed7d6f (diff)
libc: Add sendfile and queue
Diffstat (limited to 'userland/libc/sys/sendfile.c')
-rw-r--r--userland/libc/sys/sendfile.c12
1 files changed, 12 insertions, 0 deletions
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 <sys/sendfile.h>
+#include <syscall.h>
+#include <errno.h>
+
+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;
+}