diff options
author | Anton Kling <anton@kling.gg> | 2024-10-03 16:08:46 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-10-03 16:09:12 +0200 |
commit | 372c633aa22d826bc515213ad4211791440f60f8 (patch) | |
tree | b2de66c9bf612a0a149c65786335a6cebde37840 /userland/libc/sys/sendfile.c | |
parent | 226d861c9ebb7f09f95665d07d9ab5c6b7ed7d6f (diff) |
libc: Add sendfile and queue
Diffstat (limited to 'userland/libc/sys/sendfile.c')
-rw-r--r-- | userland/libc/sys/sendfile.c | 12 |
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; +} |