From 3b40cc8e9cbaa25533d18b4f3e590068130e197c Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Sat, 18 Jul 2026 01:57:13 +0900 Subject: [PATCH] fix(headers): sys/timerfd.h must compile in plain C (unblocks Wayland/glib) cbindgen auto-generated the timerfd_* prototypes from the Rust signatures, emitting a bare 'itimerspec' (not 'struct itimerspec') and a 'clockid_t' parameter with no in scope, so any C program that #includes failed to compile. That made meson's TFD_CLOEXEC feature probe report NO and aborted the whole Wayland stack (libwayland) and glib. Exclude the auto-generated prototypes (the hand-written, correct ones are emitted from the trailer) and add to the sys_includes. --- src/header/sys_timerfd/cbindgen.toml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/header/sys_timerfd/cbindgen.toml b/src/header/sys_timerfd/cbindgen.toml index 06b1634604..79ced7361f 100644 --- a/src/header/sys_timerfd/cbindgen.toml +++ b/src/header/sys_timerfd/cbindgen.toml @@ -5,8 +5,8 @@ # 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"] +# Includes clockid_t and struct itimerspec from . +sys_includes = ["signal.h", "stdint.h", "time.h", "stddef.h"] include_guard = "_SYS_TIMERFD_H" trailer = """ #ifndef TFD_CLOEXEC @@ -36,3 +36,12 @@ cpp_compat = true [enum] prefix_with_name = true + +# Do NOT auto-generate C prototypes from the Rust fn signatures: cbindgen +# renders them with a bare `itimerspec` (rather than `struct itimerspec`) and a +# `clockid_t` parameter, neither of which resolves in a plain C99 include of this +# header, which broke every consumer that probes it (e.g. libwayland's +# TFD_CLOEXEC feature test, gating the whole Wayland stack). The hand-written, +# correct prototypes are emitted from the `trailer` above instead. +[export] +exclude = ["timerfd_create", "timerfd_settime", "timerfd_gettime"]