summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-26 18:18:33 -0400
committerIan Moffett <ian@osmora.org>2024-03-26 18:21:59 -0400
commite9edee7206645adcd48b91aae6ef4734f2e98254 (patch)
tree21c3088a527e4325f181ff5bddaafdf897e209e6 /sys/include
parent4048b75fd22d5e7506681cc81feeed8930d5915d (diff)
kernel: Add initial open() implementation
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/filedesc.h7
-rw-r--r--sys/include/sys/syscall.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h
index 49d8d52..6eb500e 100644
--- a/sys/include/sys/filedesc.h
+++ b/sys/include/sys/filedesc.h
@@ -35,6 +35,10 @@
#include <sys/syscall.h>
#include <sys/types.h>
+#define O_RDONLY 0x00000
+#define O_WRONLY 0x00001
+#define O_RDWR 0x00002
+
struct proc;
struct filedesc {
@@ -50,7 +54,10 @@ int fd_alloc(struct proc *td, struct filedesc **fd_out);
struct filedesc *fd_from_fdnum(const struct proc *td, int fdno);
void fd_close_fdnum(struct proc *td, int fdno);
ssize_t write(int fd, const void *buf, size_t count);
+int open(const char *pathname, int oflag);
+
uint64_t sys_write(struct syscall_args *args);
+uint64_t sys_open(struct syscall_args *args);
#endif
#endif
diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h
index e75b193..0f066e5 100644
--- a/sys/include/sys/syscall.h
+++ b/sys/include/sys/syscall.h
@@ -39,6 +39,7 @@
enum {
SYS_exit = 1,
SYS_write,
+ SYS_open,
__MAX_SYSCALLS
};