Skip to content

Commit e0fcb4b

Browse files
committed
Define TFD_TIMER_* constants on FreeBSD.
Following up on #3341, add `TFD_TIMER_*` constants for use with the timerfd API on FreeBSD.
1 parent 6a203e9 commit e0fcb4b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

libc-test/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,11 @@ fn test_freebsd(target: &str) {
24252425
"AT_USRSTACKBASE" | "AT_USRSTACKLIM" if Some(13) > freebsd_ver => true,
24262426

24272427
// Added in FreeBSD 14
2428-
"TFD_CLOEXEC" | "TFD_NONBLOCK" if Some(14) > freebsd_ver => true,
2428+
"TFD_CLOEXEC" | "TFD_NONBLOCK" | "TFD_TIMER_ABSTIME" | "TFD_TIMER_CANCEL_ON_SET"
2429+
if Some(14) > freebsd_ver =>
2430+
{
2431+
true
2432+
}
24292433

24302434
_ => false,
24312435
}

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4732,6 +4732,8 @@ pub const RB_MULTIPLE: ::c_int = 0x20000000;
47324732

47334733
pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
47344734
pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
4735+
pub const TFD_TIMER_ABSTIME: ::c_int = 0x01;
4736+
pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02;
47354737

47364738
cfg_if! {
47374739
if #[cfg(libc_const_extern_fn)] {

0 commit comments

Comments
 (0)