diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-17 19:57:22 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-17 20:03:30 -0400 |
commit | 9dcf1391fe8cf7e09c2e9bb66f7f6c094e6268f5 (patch) | |
tree | d28f76bcdb027f9b783d1e3bd8c622cbdf218c2b /src/sys/include/os | |
parent | a6ccf59fc56f90c97a82fe851f758decaeea9aef (diff) |
kern: filedesc: Implement lseek() function
The lseek() function allows the call to resposition the file offset
using a specific whence value to govern offsetting semantics
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/os')
-rw-r--r-- | src/sys/include/os/filedesc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sys/include/os/filedesc.h b/src/sys/include/os/filedesc.h index a6a2ac5..b773de9 100644 --- a/src/sys/include/os/filedesc.h +++ b/src/sys/include/os/filedesc.h @@ -30,6 +30,7 @@ #ifndef _OS_FILEDESC_H_ #define _OS_FILEDESC_H_ 1 +#include <sys/seek.h> #include <sys/types.h> #include <os/vnode.h> @@ -117,4 +118,13 @@ ssize_t write(int fd, const void *buf, size_t count); */ ssize_t read(int fd, void *buf, size_t count); +/* + * Reposition the file offset of a file + * + * @fd: File descriptor to reposition + * @offset: Offset to move `fd' to + * @whence: How it should be repositioned + */ +off_t lseek(int fd, off_t offset, int whence); + #endif /* !_OS_FILEDESC_H_ */ |