add stub for read

This commit is contained in:
2025-12-02 17:21:24 +01:00
parent 21fb133146
commit c626887bed
2 changed files with 10 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ namespace Syscall {
enum class ID : size_t {
TEST = 0,
WRITE = 1,
READ = 2,
};
} // namespace Syscall
@@ -27,3 +28,7 @@ extern "C" ssize_t sys_safe_call(Syscall::ID id, size_t p1, size_t p2,
[[gnu::always_inline]] static inline int write(int fd, const void *buf, size_t len, int x = -1, int y = -1) {
return sys_call(Syscall::ID::WRITE, fd, (size_t)buf, len, x, y);
}
[[gnu::always_inline]] static inline int read(int fd, void *buf, size_t len){
return sys_call(Syscall::ID::READ, fd, (size_t)buf, len, 0, 0);
}