From: Andrei Tatar Date: Thu, 22 Feb 2024 19:33:58 +0000 (+0100) Subject: lib/posix-pipe: Remove posix-fdtab dependency X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fff2af00907acd8d769f3453728faea0940ddc7e;p=unikraft%2Funikraft.git lib/posix-pipe: Remove posix-fdtab dependency This change makes posix-fdtab no longer a hard dependency of posix-pipe, allowing non-fd parts of its functionality to work without the former selected. Signed-off-by: Andrei Tatar Reviewed-by: Sergiu Moga Approved-by: Sergiu Moga GitHub-Closes: #1437 --- diff --git a/lib/posix-pipe/include/uk/posix-pipe.h b/lib/posix-pipe/include/uk/posix-pipe.h index 20e615338..c92354822 100644 --- a/lib/posix-pipe/include/uk/posix-pipe.h +++ b/lib/posix-pipe/include/uk/posix-pipe.h @@ -10,14 +10,13 @@ #define __UKPOSIX_PIPE_H__ #include -#include /* File creation */ - int uk_pipefile_create(struct uk_file *pipes[2]); /* Internal syscalls */ - +#if CONFIG_LIBPOSIX_FDTAB int uk_sys_pipe(int pipefd[2], int flags); +#endif /* CONFIG_LIBPOSIX_FDTAB */ #endif /* __UKPOSIX_PIPE_H__ */ diff --git a/lib/posix-pipe/pipe.c b/lib/posix-pipe/pipe.c index bb45167f1..a49612f55 100644 --- a/lib/posix-pipe/pipe.c +++ b/lib/posix-pipe/pipe.c @@ -13,7 +13,11 @@ #include #include #include + +#if CONFIG_LIBPOSIX_FDTAB +#include #include +#endif /* CONFIG_LIBPOSIX_FDTAB */ #define PIPE_SIZE (1L << CONFIG_LIBPOSIX_PIPE_SIZE_ORDER) @@ -400,6 +404,7 @@ int uk_pipefile_create(struct uk_file *pipes[2]) return 0; } +#if CONFIG_LIBPOSIX_FDTAB /* Internal syscalls */ #define _OPEN_FLAGS (O_CLOEXEC|O_NONBLOCK|O_DIRECT) @@ -458,3 +463,4 @@ UK_SYSCALL_R_DEFINE(int, pipe2, int *, pipefd, int, flags) { return uk_sys_pipe(pipefd, flags); } +#endif /* CONFIG_LIBPOSIX_FDTAB */