diff options
author | dzwdz | 2021-09-04 19:34:51 +0200 |
---|---|---|
committer | dzwdz | 2021-09-04 19:34:51 +0200 |
commit | 613de4db61dd99e7d2049b0a303e167fa711030b (patch) | |
tree | 84b577c30aac3ac7f8360fcc7aa78f7d29479538 /src/kernel/vfs/root.c | |
parent | c4531fa5e1aa16b7ba74de2975eadf06b3052b78 (diff) |
new vfs impl pt. 1: implement open()
Diffstat (limited to 'src/kernel/vfs/root.c')
-rw-r--r-- | src/kernel/vfs/root.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/kernel/vfs/root.c b/src/kernel/vfs/root.c new file mode 100644 index 0000000..c90557b --- /dev/null +++ b/src/kernel/vfs/root.c @@ -0,0 +1,16 @@ +#include <kernel/vfs/root.h> +#include <kernel/util.h> +#include <kernel/panic.h> + +int vfs_root_handler(struct vfs_op_request *req) { + switch (req->op.type) { + case VFSOP_OPEN: + if (req->op.open.path_len == 4 + && !memcmp(req->op.open.path, "/tty", 4)) { + return 0; + } + return -1; + default: + panic(); + } +} |