From 095d4452e535263f4e51fab6eff7b7642a6e5f9e Mon Sep 17 00:00:00 2001 From: Emma Nora Theuer Date: Wed, 13 Nov 2024 17:24:31 +0100 Subject: [PATCH] streamlined code --- io.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/io.h b/io.h index 2c35a1f..5424a99 100644 --- a/io.h +++ b/io.h @@ -3,11 +3,16 @@ #define MAX_FDS 1024 -#include -#include - +#include #include "inode.h" +enum Flags { + O_READ = 1, + O_WRITE = 2, + O_APPEND = 4, + O_CREATE = 8 +}; + struct file_descriptor { Inode *inode; off_t offset; @@ -19,7 +24,8 @@ struct Process { struct file_descriptor fd_table[MAX_FDS]; }; -int allocate_fd(struct Process proc, Inode inode, int flags); +struct Process* initialize_process(); +int allocate_fd(struct Process proc, Inode inode, int flags, ...); int emmafs_open(char name[]); int emmafs_close(char name[]); //int emmafs_read(int fd)