Merge pull request #22725 from mrjbq7/timerfd_clockid_t

Fix timerfd_clockid_t on linux and freebsd
This commit is contained in:
Alex Rønne Petersen 2025-02-03 22:51:13 +01:00 committed by GitHub
commit 08d661fcfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -222,11 +222,12 @@ pub const ARCH = switch (native_os) {
// that actually work.
pub const TIMERFD_CLOCK = timerfd_clockid_t;
pub const timerfd_clockid_t = switch (native_os) {
.linux, .freebsd => enum(u32) {
.freebsd => enum(u32) {
REALTIME = 0,
MONOTONIC = 1,
MONOTONIC = 4,
_,
},
.linux => linux.timerfd_clockid_t,
else => clockid_t,
};

View File

@ -4722,6 +4722,9 @@ pub const TIMERFD_CLOCK = timerfd_clockid_t;
pub const timerfd_clockid_t = enum(u32) {
REALTIME = 0,
MONOTONIC = 1,
BOOTTIME = 7,
REALTIME_ALARM = 8,
BOOTTIME_ALARM = 9,
_,
};