use rustix_futex_sync::Once;
use libc::c_int;
libc_type!(Once, pthread_once_t);
#[cfg(test)]
static_assertions::const_assert_eq!(libc::PTHREAD_ONCE_INIT, unsafe {
core::mem::transmute(Once::new())
});
#[no_mangle]
unsafe extern "C" fn pthread_once(
once_control: *mut libc::pthread_once_t,
init_routine: extern "C" fn(),
) -> c_int {
libc!(libc::pthread_once(once_control, init_routine));
(*once_control.cast::<Once>()).call_once(move || {
init_routine();
});
0
}