Skip to content

Commit 2561d7c

Browse files
JohnTitorAkhilTThomas
authored andcommitted
Merge pull request rust-lang#3769 from joboet/libc-0.2
macOS: add `os_sync_wait_on_address` and related definitions
2 parents e77394c + a0f867b commit 2561d7c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ pub type os_clockid_t = u32;
137137
pub type os_sync_wait_on_address_flags_t = u32;
138138
pub type os_sync_wake_by_address_flags_t = u32;
139139

140+
pub type os_clockid_t = u32;
141+
142+
pub type os_sync_wait_on_address_flags_t = u32;
143+
pub type os_sync_wake_by_address_flags_t = u32;
144+
140145
pub type os_unfair_lock = os_unfair_lock_s;
141146
pub type os_unfair_lock_t = *mut os_unfair_lock;
142147

@@ -5854,6 +5859,40 @@ extern "C" {
58545859
flags: os_sync_wake_by_address_flags_t,
58555860
) -> c_int;
58565861

5862+
// Available starting with macOS 14.4.
5863+
pub fn os_sync_wait_on_address(
5864+
addr: *mut ::c_void,
5865+
value: u64,
5866+
size: ::size_t,
5867+
flags: os_sync_wait_on_address_flags_t,
5868+
) -> ::c_int;
5869+
pub fn os_sync_wait_on_address_with_deadline(
5870+
addr: *mut ::c_void,
5871+
value: u64,
5872+
size: ::size_t,
5873+
flags: os_sync_wait_on_address_flags_t,
5874+
clockid: os_clockid_t,
5875+
deadline: u64,
5876+
) -> ::c_int;
5877+
pub fn os_sync_wait_on_address_with_timeout(
5878+
addr: *mut ::c_void,
5879+
value: u64,
5880+
size: ::size_t,
5881+
flags: os_sync_wait_on_address_flags_t,
5882+
clockid: os_clockid_t,
5883+
timeout_ns: u64,
5884+
) -> ::c_int;
5885+
pub fn os_sync_wake_by_address_any(
5886+
addr: *mut ::c_void,
5887+
size: ::size_t,
5888+
flags: os_sync_wake_by_address_flags_t,
5889+
) -> ::c_int;
5890+
pub fn os_sync_wake_by_address_all(
5891+
addr: *mut ::c_void,
5892+
size: ::size_t,
5893+
flags: os_sync_wake_by_address_flags_t,
5894+
) -> ::c_int;
5895+
58575896
pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
58585897
pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
58595898
pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);

0 commit comments

Comments
 (0)