diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-06 21:59:20 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-06 21:59:29 -0400 |
commit | 5adf5344bfa4388a70c054308447c64c06b98265 (patch) | |
tree | 4fc93d7a352a359a53d8dd464d385a43efccb52c /src/sys/include | |
parent | 0b4270f30b7746d3400513e2c16ff833e6fbeb90 (diff) | |
parent | 473afa3b7e826063b66e579cfbebaa99ee4602ab (diff) |
Fix conflicts
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include')
-rw-r--r-- | src/sys/include/compat/unix/syscall.h | 5 | ||||
-rw-r--r-- | src/sys/include/os/filedesc.h | 11 | ||||
-rw-r--r-- | src/sys/include/sys/syscall.h | 1 |
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; |