Skip to content

Commit

Permalink
Add FreeBSD's umtx timeout struct and flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Apr 28, 2022
1 parent daebd3e commit b3f9814
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Expand Up @@ -1939,6 +1939,7 @@ fn test_freebsd(target: &str) {
"sys/ucontext.h",
"sys/uio.h",
"sys/ktrace.h",
"sys/umtx.h",
"sys/un.h",
"sys/user.h",
"sys/utsname.h",
Expand Down
1 change: 1 addition & 0 deletions libc-test/semver/freebsd.txt
Expand Up @@ -1240,6 +1240,7 @@ UF_REPARSE
UF_SETTABLE
UF_SPARSE
UF_SYSTEM
UMTX_ABSTIME
UMTX_OP_WAIT
UMTX_OP_WAKE
UMTX_OP_MUTEX_TRYLOCK
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -1198,6 +1198,12 @@ s_no_extra_traits! {
pub ifdr_vendor: u32,
pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize],
}

pub struct _umtx_time {
pub timeout: ::timespec,
pub flags: u32,
pub clockid: u32,
}
}

cfg_if! {
Expand Down Expand Up @@ -3682,6 +3688,8 @@ pub const UMTX_OP_SEM2_WAKE: ::c_int = 24;
pub const UMTX_OP_SHM: ::c_int = 25;
pub const UMTX_OP_ROBUST_LISTS: ::c_int = 26;

pub const UMTX_ABSTIME: u32 = 1;

const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
Expand Down

0 comments on commit b3f9814

Please sign in to comment.