Skip to content

Commit db5db66

Browse files
committed
Add FreeBSD's umtx timeout struct and flag.
1 parent daebd3e commit db5db66

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,7 @@ fn test_freebsd(target: &str) {
19391939
"sys/ucontext.h",
19401940
"sys/uio.h",
19411941
"sys/ktrace.h",
1942+
"sys/umtx.h",
19421943
"sys/un.h",
19431944
"sys/user.h",
19441945
"sys/utsname.h",

libc-test/semver/freebsd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ UF_REPARSE
12401240
UF_SETTABLE
12411241
UF_SPARSE
12421242
UF_SYSTEM
1243+
UMTX_ABSTIME
12431244
UMTX_OP_WAIT
12441245
UMTX_OP_WAKE
12451246
UMTX_OP_MUTEX_TRYLOCK

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,12 @@ s_no_extra_traits! {
11981198
pub ifdr_vendor: u32,
11991199
pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize],
12001200
}
1201+
1202+
pub struct _umtx_time {
1203+
pub _timeout: ::timespec,
1204+
pub _flags: u32,
1205+
pub _clockid: u32,
1206+
}
12011207
}
12021208

12031209
cfg_if! {
@@ -3682,6 +3688,8 @@ pub const UMTX_OP_SEM2_WAKE: ::c_int = 24;
36823688
pub const UMTX_OP_SHM: ::c_int = 25;
36833689
pub const UMTX_OP_ROBUST_LISTS: ::c_int = 26;
36843690

3691+
pub const UMTX_ABSTIME: u32 = 1;
3692+
36853693
const_fn! {
36863694
{const} fn _ALIGN(p: usize) -> usize {
36873695
(p + _ALIGNBYTES) & !_ALIGNBYTES

0 commit comments

Comments
 (0)