From 7e8ff80fadd2066f8fa9a058efe23aa301325433 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 31 Jul 2025 06:16:22 -0400 Subject: kernel: descrip: Add 'td' parameter to fd routines Update the signature of 'fd_get()', 'fd_alloc()' and 'fd_dup()' to include a pointer to the process to target. This improves the flexibility of the file descriptor API. Signed-off-by: Ian Moffett --- sys/include/sys/filedesc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/include') diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h index 4ce2db2..adbcfa8 100644 --- a/sys/include/sys/filedesc.h +++ b/sys/include/sys/filedesc.h @@ -55,12 +55,12 @@ 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_alloc(struct proc *td, struct filedesc **fd_out); int fd_open(const char *pathname, int flags); off_t fd_seek(int fildes, off_t offset, int whence); -int fd_dup(int fd); -struct filedesc *fd_get(unsigned int fdno); +int fd_dup(struct proc *td, int fd); +struct filedesc *fd_get(struct proc *td, unsigned int fdno); scret_t sys_lseek(struct syscall_args *scargs); -- cgit v1.2.3