authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-02-03 22:51:13+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-02-03 22:51:13+01:00
log08d661fcfdfb0a7b99f8bfbf4912acd21cf72d6f
tree914f049b3380f18720b4402052027a129216f1bf
parent317722b37b201e393aed60045f4bf9649103e63e
parent7309a13bd880982209832c4845912bddc245dcc3
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #22725 from mrjbq7/timerfd_clockid_t

Fix timerfd_clockid_t on linux and freebsd

2 files changed, 6 insertions(+), 2 deletions(-)

lib/std/c.zig+3-2
...@@ -222,11 +222,12 @@ pub const ARCH = switch (native_os) {...@@ -222,11 +222,12 @@ pub const ARCH = switch (native_os) {
222// that actually work.222// that actually work.
223pub const TIMERFD_CLOCK = timerfd_clockid_t;223pub const TIMERFD_CLOCK = timerfd_clockid_t;
224pub const timerfd_clockid_t = switch (native_os) {224pub const timerfd_clockid_t = switch (native_os) {
225 .linux, .freebsd => enum(u32) {225 .freebsd => enum(u32) {
226 REALTIME = 0,226 REALTIME = 0,
227 MONOTONIC = 1,227 MONOTONIC = 4,
228 _,228 _,
229 },229 },
230 .linux => linux.timerfd_clockid_t,
230 else => clockid_t,231 else => clockid_t,
231};232};
232233
lib/std/os/linux.zig+3
...@@ -4722,6 +4722,9 @@ pub const TIMERFD_CLOCK = timerfd_clockid_t;...@@ -4722,6 +4722,9 @@ pub const TIMERFD_CLOCK = timerfd_clockid_t;
4722pub const timerfd_clockid_t = enum(u32) {4722pub const timerfd_clockid_t = enum(u32) {
4723 REALTIME = 0,4723 REALTIME = 0,
4724 MONOTONIC = 1,4724 MONOTONIC = 1,
4725 BOOTTIME = 7,
4726 REALTIME_ALARM = 8,
4727 BOOTTIME_ALARM = 9,
4725 _,4728 _,
4726};4729};
47274730