]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-timerfd: Remove posix-fdtab dependency
authorAndrei Tatar <andrei@unikraft.io>
Thu, 22 Feb 2024 19:38:00 +0000 (20:38 +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-timerfd, 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-timerfd/include/uk/posix-timerfd.h
lib/posix-timerfd/timerfd.c

index 9f9ff657a29c36b2ec3083715936e57b542df2e6..4101dc06e302da7b886f96f1b4004af9fde6679e 100644 (file)
@@ -9,13 +9,16 @@
 
 #include <sys/timerfd.h>
 
+#include <uk/file.h>
+
 /* File creation */
 
 struct uk_file *uk_timerfile_create(clockid_t id);
 
 /* Internal Syscalls */
-
+#if CONFIG_LIBPOSIX_FDTAB
 int uk_sys_timerfd_create(clockid_t id, int flags);
+#endif /* CONFIG_LIBPOSIX_FDTAB */
 
 int uk_sys_timerfd_settime(const struct uk_file *f, int flags,
                           const struct itimerspec *new_value,
index 4b5fe9d55e0d62979631e3dda358d65414c6ccb3..202f38b2a0da6e2f3f35d60d44c8120f28a98db0 100644 (file)
 #include <uk/errptr.h>
 #include <uk/file/nops.h>
 #include <uk/posix-fd.h>
-#include <uk/posix-fdtab.h>
 #include <uk/posix-time.h>
 #include <uk/posix-timerfd.h>
 #include <uk/sched.h>
 #include <uk/timeutil.h>
+
+#if CONFIG_LIBPOSIX_FDTAB
+#include <uk/posix-fdtab.h>
 #include <uk/syscall.h>
+#endif /* CONFIG_LIBPOSIX_FDTAB */
 
 
 static const char TIMERFD_VOLID[] = "timerfd_vol";
@@ -278,6 +281,8 @@ struct uk_file *uk_timerfile_create(clockid_t id)
 
 /* Internal API */
 
+#if CONFIG_LIBPOSIX_FDTAB
+
 int uk_sys_timerfd_create(clockid_t id, int flags)
 {
        int ret;
@@ -299,6 +304,7 @@ int uk_sys_timerfd_create(clockid_t id, int flags)
        return ret;
 }
 
+#endif /* CONFIG_LIBPOSIX_FDTAB */
 
 int uk_sys_timerfd_settime(const struct uk_file *f, int flags,
                           const struct itimerspec *new_value,
@@ -358,6 +364,7 @@ int uk_sys_timerfd_gettime(const struct uk_file *f,
        return 0;
 }
 
+#if CONFIG_LIBPOSIX_FDTAB
 /* Syscalls */
 
 UK_SYSCALL_R_DEFINE(int, timerfd_create, int, id, int, flags)
@@ -399,3 +406,4 @@ UK_SYSCALL_R_DEFINE(int, timerfd_gettime, int, fd,
        uk_fdtab_ret(of);
        return r;
 }
+#endif /* CONFIG_LIBPOSIX_FDTAB */