From: Andrei Tatar Date: Thu, 22 Feb 2024 19:38:00 +0000 (+0100) Subject: lib/posix-timerfd: Remove posix-fdtab dependency X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0ba34bf36145aca6bcb909b4c49a3e7e582616e5;p=unikraft%2Funikraft.git lib/posix-timerfd: Remove posix-fdtab dependency 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 Reviewed-by: Sergiu Moga Approved-by: Sergiu Moga GitHub-Closes: #1437 --- diff --git a/lib/posix-timerfd/include/uk/posix-timerfd.h b/lib/posix-timerfd/include/uk/posix-timerfd.h index 9f9ff657a..4101dc06e 100644 --- a/lib/posix-timerfd/include/uk/posix-timerfd.h +++ b/lib/posix-timerfd/include/uk/posix-timerfd.h @@ -9,13 +9,16 @@ #include +#include + /* 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, diff --git a/lib/posix-timerfd/timerfd.c b/lib/posix-timerfd/timerfd.c index 4b5fe9d55..202f38b2a 100644 --- a/lib/posix-timerfd/timerfd.c +++ b/lib/posix-timerfd/timerfd.c @@ -13,12 +13,15 @@ #include #include #include -#include #include #include #include #include + +#if CONFIG_LIBPOSIX_FDTAB +#include #include +#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 */