diff --git a/libc/read.cpp b/libc/read.cpp index 542213f4..23eb71c8 100644 --- a/libc/read.cpp +++ b/libc/read.cpp @@ -36,8 +36,9 @@ retry: return result; } -extern "C" ssize_t pread(int, void*, size_t, off_t) +DEFN_SYSCALL4(ssize_t, sys_pread, SYSCALL_PREAD, int, void*, size_t, off_t); + +extern "C" ssize_t pread(int fd, void* buf, size_t count, off_t offset) { - errno = ENOSYS; - return -1; + return sys_pread(fd, buf, count, offset); } diff --git a/libc/write.cpp b/libc/write.cpp index 9d099de8..ced30e71 100644 --- a/libc/write.cpp +++ b/libc/write.cpp @@ -36,8 +36,9 @@ retry: return result; } -extern "C" ssize_t pwrite(int, const void*, size_t, off_t) +DEFN_SYSCALL4(ssize_t, sys_pwrite, SYSCALL_PWRITE, int, const void*, size_t, off_t); + +extern "C" ssize_t pwrite(int fd, const void* buf, size_t count, off_t offset) { - errno = ENOSYS; - return -1; + return sys_pwrite(fd, buf, count, offset); }