From 83fa1f34ea744da7d26997179a0dd6af751dd8b0 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 24 Aug 2021 16:25:50 +0200 Subject: add some scaffolding for file descriptors --- src/init/syscalls.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/init') diff --git a/src/init/syscalls.c b/src/init/syscalls.c index 0be7917..4f207db 100644 --- a/src/init/syscalls.c +++ b/src/init/syscalls.c @@ -24,6 +24,18 @@ int _syscall_mount(const char *path, int len, fd_t fd) { return _syscall(_SYSCALL_MOUNT, (int)path, len, fd); } +int _syscall_fd_read(fd_t fd, char *buf, int len) { + return _syscall(_SYSCALL_FD_READ, fd, (int)buf, len); +} + +int _syscall_fd_write(fd_t fd, char *buf, int len) { + return _syscall(_SYSCALL_FD_WRITE, fd, (int)buf, len); +} + +int _syscall_fd_close(fd_t fd) { + return _syscall(_SYSCALL_FD_CLOSE, fd, 0, 0); +} + int _syscall_debuglog(const char *msg, size_t len) { return _syscall(_SYSCALL_DEBUGLOG, (int)msg, len, 0); } -- cgit v1.2.3