diff options
author | Anton Kling <anton@kling.gg> | 2023-11-24 21:47:02 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-11-24 21:47:02 +0100 |
commit | 4764846cc2afe0e56f4490e3973b7322c2129e29 (patch) | |
tree | 64aa0b7df0f5422a6c52f0b67f4b9a9158bfa8da /userland/libc/unistd | |
parent | 08b63b747f9a6b4d1460195f6ca68680abcdd656 (diff) |
Refactor write() and pwrite()
Diffstat (limited to 'userland/libc/unistd')
-rw-r--r-- | userland/libc/unistd/pwrite.c | 6 | ||||
-rw-r--r-- | userland/libc/unistd/write.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/userland/libc/unistd/pwrite.c b/userland/libc/unistd/pwrite.c new file mode 100644 index 0000000..c777865 --- /dev/null +++ b/userland/libc/unistd/pwrite.c @@ -0,0 +1,6 @@ +#include <syscall.h> +#include <unistd.h> + +int pwrite(int fd, const char *buf, size_t count, size_t offset) { + return syscall(SYS_PWRITE, fd, buf, count, offset, 0); +} diff --git a/userland/libc/unistd/write.c b/userland/libc/unistd/write.c new file mode 100644 index 0000000..661fb01 --- /dev/null +++ b/userland/libc/unistd/write.c @@ -0,0 +1,6 @@ +#include <syscall.h> +#include <unistd.h> + +int write(int fd, const char *buf, size_t count) { + return syscall(SYS_WRITE, fd, buf, count, 0, 0); +} |