diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-06 21:25:02 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-06 21:25:02 -0400 |
commit | 25461d1d5df8f6d1cf415eeb7d8d7c073171def5 (patch) | |
tree | c85ba1eab542f0a865206a5b8f39eda93f6d15e6 /src/sys/include | |
parent | 272a239d0e475de8574dbf6ccaed0d586f0027df (diff) |
kern: filedesc: Add fd_open() function
Introduce the fd_open() function as apart of the kernel file
descriptor API to open a file and get a file descriptor.
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include')
-rw-r--r-- | src/sys/include/os/filedesc.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 |