summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-27 19:03:31 -0400
committerIan Moffett <ian@osmora.org>2025-06-27 19:04:55 -0400
commitbbd861c0cd4c26e2699392fec3ae0ec7df8ab145 (patch)
treecbed69b27dbb16486f28d0995ab9524266c508a3 /sys/include
parent8877f9b8a8992388b4f64d425a48b02a3229cf61 (diff)
kernel: vfs: Add support for O_CREAT flag
Add support for the O_CREAT flag which allows file creation upon an open() call. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/fcntl.h1
-rw-r--r--sys/include/sys/vnode.h8
2 files changed, 9 insertions, 0 deletions
diff --git a/sys/include/sys/fcntl.h b/sys/include/sys/fcntl.h
index 122a378..83d38af 100644
--- a/sys/include/sys/fcntl.h
+++ b/sys/include/sys/fcntl.h
@@ -33,6 +33,7 @@
#define O_RDONLY 0x0000
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
+#define O_CREAT 0x0004
/* Makes seal checking easier */
#if defined(_KERNEL)
diff --git a/sys/include/sys/vnode.h b/sys/include/sys/vnode.h
index cd71817..1a6b2aa 100644
--- a/sys/include/sys/vnode.h
+++ b/sys/include/sys/vnode.h
@@ -86,6 +86,13 @@ struct vop_lookup_args {
struct vnode **vpp; /* Result vnode */
};
+struct vop_create_args {
+ const char *path; /* Full path */
+ const char *ppath; /* Parent path */
+ struct vnode *dirvp; /* Directory vnode */
+ struct vnode **vpp; /* Result vnode */
+};
+
/*
* A field in this structure is unavailable
* if it has a value of VNOVAL.
@@ -106,6 +113,7 @@ struct vops {
int(*read)(struct vnode *vp, struct sio_txn *sio);
int(*write)(struct vnode *vp, struct sio_txn *sio);
int(*reclaim)(struct vnode *vp);
+ int(*create)(struct vop_create_args *args);
};
extern struct vnode *g_root_vnode;