summaryrefslogtreecommitdiff
path: root/kernel/include/comus/fs.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-30 21:07:46 -0400
committerFreya Murphy <freya@freyacat.org>2025-05-01 15:51:32 -0400
commit1a10a3725e7bea67e558715f6e9f78abcb415b3a (patch)
tree1f35cf35f61cd58a86f2a8e7ea14c565db20a211 /kernel/include/comus/fs.h
parenttarfs (diff)
downloadcomus-1a10a3725e7bea67e558715f6e9f78abcb415b3a.tar.gz
comus-1a10a3725e7bea67e558715f6e9f78abcb415b3a.tar.bz2
comus-1a10a3725e7bea67e558715f6e9f78abcb415b3a.zip
finish syscall impls
Diffstat (limited to 'kernel/include/comus/fs.h')
-rw-r--r--kernel/include/comus/fs.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/include/comus/fs.h b/kernel/include/comus/fs.h
index 2f678b6..044330b 100644
--- a/kernel/include/comus/fs.h
+++ b/kernel/include/comus/fs.h
@@ -148,6 +148,15 @@ struct file {
void (*close)(struct file *file);
};
+/// open flags
+enum {
+ O_CREATE = 0x01,
+ O_RDONLY = 0x02,
+ O_WRONLY = 0x04,
+ O_APPEND = 0x08,
+ O_RDWR = 0x10,
+};
+
/// file system vtable, used for opening
/// and stating files. filesystem mount functions must
/// set fs_name, fs_disk, open, and stat.
@@ -200,7 +209,7 @@ struct file_system {
/// filesystem name
const char *fs_name;
/// opens a file
- int (*open)(struct file_system *fs, const char *fullpath,
+ int (*open)(struct file_system *fs, const char *fullpath, int flags,
struct file **out);
/// stats a file
int (*stat)(struct file_system *fs, const char *fullpath,