From f7dc760dd7a2dd8ba5a133e396e717b7886059f4 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 4 Nov 2024 01:41:14 -0500 Subject: kernel: descrip: Add support for fd duplication Sometimes we may need to duplicate a file descriptor and create a new fdno that refers to the same vnode. The fd_dup() function enables us to do this when needed. Signed-off-by: Ian Moffett --- sys/include/sys/filedesc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h index f5f24db..94946a0 100644 --- a/sys/include/sys/filedesc.h +++ b/sys/include/sys/filedesc.h @@ -48,6 +48,8 @@ int fd_read(unsigned int fd, void *buf, size_t count); int fd_alloc(struct filedesc **fd_out); int fd_open(const char *pathname, int flags); + +int fd_dup(int fd); struct filedesc *fd_get(unsigned int fdno); #endif /* !_SYS_FILEDESC_H_ */ -- cgit v1.2.3