From e47a604197bfa8370d9f90a817ba0e1038b5260a Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Sun, 12 Jul 2026 19:19:35 +0300 Subject: [PATCH] rb: add cbindgen config for sys_timerfd sys_timerfd was fully implemented in Rust (timerfd_create, timerfd_settime, timerfd_gettime, itimerspec support) but lacked the cbindgen.toml needed to generate the C header. Qt6's QSocketNotifier and many other C programs depend on this header. Without it, cbindgen skips the directory entirely. This adds the cbindgen config + trailer with all function prototypes, matching the pattern used by sys_signalfd. --- src/header/sys_timerfd/cbindgen.toml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/header/sys_timerfd/cbindgen.toml diff --git a/src/header/sys_timerfd/cbindgen.toml b/src/header/sys_timerfd/cbindgen.toml new file mode 100644 index 0000000000..06b1634604 --- /dev/null +++ b/src/header/sys_timerfd/cbindgen.toml @@ -0,0 +1,38 @@ +# Linux kernel timerfd_create/timerfd_settime/timerfd_gettime +# See . +# +# This header is non-POSIX (a Linux/glibc extension) but fully implemented +# in relibc. It is required by Qt6 for QSocketNotifier and many other +# C programs that use timer file descriptors. +# +# Includes the itimerspec from . +sys_includes = ["signal.h", "stdint.h", "stddef.h"] +include_guard = "_SYS_TIMERFD_H" +trailer = """ +#ifndef TFD_CLOEXEC +#define TFD_CLOEXEC 0x80000 +#endif + +#ifndef TFD_NONBLOCK +#define TFD_NONBLOCK 0x800 +#endif + +#ifndef TFD_TIMER_ABSTIME +#define TFD_TIMER_ABSTIME 0x1 +#endif + +#ifndef TFD_TIMER_CANCEL_ON_SET +#define TFD_TIMER_CANCEL_ON_SET 0x2 +#endif + +int timerfd_create(int clockid, int flags); +int timerfd_settime(int fd, int flags, const struct itimerspec *new_value, struct itimerspec *old_value); +int timerfd_gettime(int fd, struct itimerspec *curr_value); +""" +language = "C" +style = "Tag" +no_includes = true +cpp_compat = true + +[enum] +prefix_with_name = true