summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/fcntl.h5
-rw-r--r--sys/include/sys/filedesc.h2
-rw-r--r--sys/include/sys/syscall.h1
-rw-r--r--sys/include/sys/vfs.h1
-rw-r--r--sys/include/sys/vnode.h2
5 files changed, 11 insertions, 0 deletions
diff --git a/sys/include/sys/fcntl.h b/sys/include/sys/fcntl.h
index 7a62cdd..122a378 100644
--- a/sys/include/sys/fcntl.h
+++ b/sys/include/sys/fcntl.h
@@ -34,4 +34,9 @@
#define O_WRONLY 0x0001
#define O_RDWR 0x0002
+/* Makes seal checking easier */
+#if defined(_KERNEL)
+#define O_ALLOW_WR (O_RDWR | O_WRONLY)
+#endif
+
#endif /* !_SYS_FCTNL_H_ */
diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h
index 9a6230a..a544811 100644
--- a/sys/include/sys/filedesc.h
+++ b/sys/include/sys/filedesc.h
@@ -39,12 +39,14 @@ struct filedesc {
off_t offset;
bool is_dir;
int refcnt;
+ int flags;
struct vnode *vp;
struct spinlock lock;
};
int fd_close(unsigned int fd);
int fd_read(unsigned int fd, void *buf, size_t count);
+int fd_write(unsigned int fd, void *buf, size_t count);
int fd_alloc(struct filedesc **fd_out);
int fd_open(const char *pathname, int flags);
diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h
index b724e8b..41d1e78 100644
--- a/sys/include/sys/syscall.h
+++ b/sys/include/sys/syscall.h
@@ -42,6 +42,7 @@
#define SYS_close 4
#define SYS_stat 5
#define SYS_sysctl 6
+#define SYS_write 7
#if defined(_KERNEL)
/* Syscall return value and arg type */
diff --git a/sys/include/sys/vfs.h b/sys/include/sys/vfs.h
index 61f6673..1ff722a 100644
--- a/sys/include/sys/vfs.h
+++ b/sys/include/sys/vfs.h
@@ -38,6 +38,7 @@
scret_t sys_open(struct syscall_args *scargs);
scret_t sys_close(struct syscall_args *args);
scret_t sys_read(struct syscall_args *scargs);
+scret_t sys_write(struct syscall_args *sargs);
scret_t sys_stat(struct syscall_args *scargs);
#endif /* _KERNEL */
diff --git a/sys/include/sys/vnode.h b/sys/include/sys/vnode.h
index 5cbaa15..33092f9 100644
--- a/sys/include/sys/vnode.h
+++ b/sys/include/sys/vnode.h
@@ -101,6 +101,7 @@ struct vops {
int(*lookup)(struct vop_lookup_args *args);
int(*getattr)(struct vop_getattr_args *args);
int(*read)(struct vnode *vp, struct sio_txn *sio);
+ int(*write)(struct vnode *vp, struct sio_txn *sio);
int(*reclaim)(struct vnode *vp);
};
@@ -117,6 +118,7 @@ int vfs_release_vnode(struct vnode *vp);
int vfs_vop_lookup(struct vnode *vp, struct vop_lookup_args *args);
int vfs_vop_read(struct vnode *vp, struct sio_txn *sio);
+int vfs_vop_write(struct vnode *vp, struct sio_txn *sio);
int vfs_vop_getattr(struct vnode *vp, struct vop_getattr_args *args);
#endif /* _KERNEL */