Kernel/LibC: Implement pwrite and make pread non-locking

This commit is contained in:
2025-05-20 20:29:42 +03:00
parent 5d80c880c8
commit 44b762f916
4 changed files with 21 additions and 8 deletions

View File

@@ -60,6 +60,7 @@ __BEGIN_DECLS
O(SYS_READLINKAT, readlinkat) \
O(SYS_MSYNC, msync) \
O(SYS_PREAD, pread) \
O(SYS_PWRITE, pwrite) \
O(SYS_FCHOWNAT, fchownat) \
O(SYS_LOAD_KEYMAP, load_keymap) \
O(SYS_SOCKET, socket) \

View File

@@ -127,6 +127,11 @@ ssize_t pread(int fildes, void* buf, size_t nbyte, off_t offset)
return syscall(SYS_PREAD, fildes, buf, nbyte, offset);
}
ssize_t pwrite(int fildes, const void* buf, size_t nbyte, off_t offset)
{
return syscall(SYS_PWRITE, fildes, buf, nbyte, offset);
}
off_t lseek(int fildes, off_t offset, int whence)
{
return syscall(SYS_SEEK, fildes, offset, whence);