From cdcb3956409f81f0680892e9f9ba7f78fe95155b Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 6 Jul 2023 22:15:55 +0300 Subject: [PATCH] LibC: add read() and write() to unistd --- libc/unistd.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libc/unistd.cpp b/libc/unistd.cpp index beddffdd..f2b4dfa0 100644 --- a/libc/unistd.cpp +++ b/libc/unistd.cpp @@ -273,6 +273,16 @@ int close(int fd) return syscall(SYS_CLOSE, fd); } +ssize_t read(int fildes, void* buf, size_t nbyte) +{ + return syscall(SYS_READ, fildes, buf, nbyte); +} + +ssize_t write(int fildes, const void* buf, size_t nbyte) +{ + return syscall(SYS_WRITE, fildes, buf, nbyte); +} + int execl(const char* pathname, const char* arg0, ...) { if (arg0 == nullptr)