From add3e844cf9eaf49010fbee2aa73977086e47428 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Mon, 25 Mar 2024 21:59:24 -0400 Subject: kernel: filedesc: Return status in fd_alloc() It is better for fd_alloc() to return the status and have one of the arguments point to an output than have fd_alloc() return the allocated file descriptor just like that. Signed-off-by: Ian Moffett --- sys/include/sys/filedesc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/include') diff --git a/sys/include/sys/filedesc.h b/sys/include/sys/filedesc.h index df30c69..49d8d52 100644 --- a/sys/include/sys/filedesc.h +++ b/sys/include/sys/filedesc.h @@ -46,7 +46,7 @@ struct filedesc { }; #if defined(_KERNEL) -struct filedesc *fd_alloc(struct proc *td); +int fd_alloc(struct proc *td, struct filedesc **fd_out); struct filedesc *fd_from_fdnum(const struct proc *td, int fdno); void fd_close_fdnum(struct proc *td, int fdno); ssize_t write(int fd, const void *buf, size_t count); -- cgit v1.2.3