vfs: add open and close syscalls

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-19 20:10:15 -04:00
commit debd580784
2 changed files with 78 additions and 2 deletions

View file

@ -6,6 +6,7 @@
#include <kernel/spinlock.h>
#include <kernel/mem.h>
#include <kernel/page.h>
#include <fs/vfs.h>
#include <lib/rbtree.h>
@ -29,6 +30,14 @@ struct proc_alloc {
size_t len;
};
struct file {
dirent_t *dirent;
u64 flags;
u64 offset;
u64 refcount;
spinlock_t lock;
};
struct proc;
struct thread {
tid_t tid;
@ -62,6 +71,10 @@ struct proc {
uaddr_t entry;
spinlock_t fd_lock;
size_t fd_array_size;
struct file *fdt;
struct ehdr *ehdr;
struct phdr *phdrs;
size_t n_phdrs;