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