Skip to content

Commit 777b719

Browse files
committed
fix cross compiling build
1 parent 3760c05 commit 777b719

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Diff for: library/std/src/sys/pal/unix/thread.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -854,11 +854,20 @@ pub mod guard {
854854
static mut GUARD_PAGES: usize = 1;
855855

856856
ONCE.call_once(|| {
857+
extern "C" {
858+
pub fn sysctlbyname(
859+
oid: *const libc::c_char,
860+
ov: *mut libc::c_void,
861+
osize: *mut libc::size_t,
862+
nv: *const libc::c_void,
863+
nsize: libc::size_t,
864+
) -> libc::c_int;
865+
}
857866
let mut guard: usize = 0;
858867
let mut size = crate::mem::size_of_val(&guard);
859868
let oid = crate::ffi::CStr::from_bytes_with_nul(b"security.bsd.stack_guard_page\0")
860869
.unwrap();
861-
let res = libc::sysctlbyname(
870+
let res = sysctlbyname(
862871
oid.as_ptr(),
863872
&mut guard as *mut _ as *mut _,
864873
&mut size as *mut _ as *mut _,

0 commit comments

Comments
 (0)