]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-pipe: Remove posix-fdtab dependency
authorAndrei Tatar <andrei@unikraft.io>
Thu, 22 Feb 2024 19:33:58 +0000 (20:33 +0100)
committerUnikraft Bot <monkey@unikraft.io>
Tue, 4 Feb 2025 10:22:02 +0000 (10:22 +0000)
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 <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Sergiu Moga <sergiu@unikraft.io>
GitHub-Closes: #1437

lib/posix-pipe/include/uk/posix-pipe.h
lib/posix-pipe/pipe.c

index 20e615338ac5782b91a799a837c2c79641dbd2bf..c92354822db9ca8b3f6778d15134514217843656 100644 (file)
 #define __UKPOSIX_PIPE_H__
 
 #include <uk/file.h>
-#include <uk/posix-fdtab.h>
 
 /* 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__ */
index bb45167f10f9292763519be0bbbe94743df4d6a8..a49612f5574d1226284ba85e4eb28691f7681ea2 100644 (file)
 #include <uk/file/nops.h>
 #include <uk/posix-fd.h>
 #include <uk/posix-pipe.h>
+
+#if CONFIG_LIBPOSIX_FDTAB
+#include <uk/posix-fdtab.h>
 #include <uk/syscall.h>
+#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 */