summaryrefslogtreecommitdiff
path: root/src/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/include')
-rw-r--r--src/sys/include/compat/unix/syscall.h5
-rw-r--r--src/sys/include/os/filedesc.h11
-rw-r--r--src/sys/include/sys/syscall.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h
index 5339d47..14088f4 100644
--- a/src/sys/include/compat/unix/syscall.h
+++ b/src/sys/include/compat/unix/syscall.h
@@ -55,6 +55,11 @@ scret_t sys_cross(struct syscall_args *scargs);
*/
scret_t sys_query(struct syscall_args *scargs);
+/*
+ * Open a file
+ */
+scret_t sys_open(struct syscall_args *scargs);
+
#ifdef _NEED_UNIX_SCTAB
scret_t(*g_unix_sctab[])(struct syscall_args *) = {
[SYS_none] = NULL,
diff --git a/src/sys/include/os/filedesc.h b/src/sys/include/os/filedesc.h
index 87bf242..c339ed6 100644
--- a/src/sys/include/os/filedesc.h
+++ b/src/sys/include/os/filedesc.h
@@ -60,6 +60,17 @@ struct filedesc {
int fdtab_init(struct proc *procp);
/*
+ * Open a file
+ *
+ * @path: Path to file in which we wish to open
+ * @mode: Mode of our desired file
+ *
+ * Returns the file descriptor on success,
+ * otherwise a less than zero value on failure.
+ */
+int fd_open(const char *path, mode_t mode);
+
+/*
* Write to a file descriptor
*
* @fd: File descriptor to write to
diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h
index 4121d54..181f734 100644
--- a/src/sys/include/sys/syscall.h
+++ b/src/sys/include/sys/syscall.h
@@ -50,6 +50,7 @@
#define SYS_query 0x05 /* query a border (mandatory) */
#define SYS_spawn 0x06 /* spawn a process */
#define SYS_mount 0x07 /* mount a filesystem */
+#define SYS_open 0x08 /* open a file */
typedef __ssize_t scret_t;
typedef __ssize_t scarg_t;