We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3760c05 commit 777b719Copy full SHA for 777b719
library/std/src/sys/pal/unix/thread.rs
@@ -854,11 +854,20 @@ pub mod guard {
854
static mut GUARD_PAGES: usize = 1;
855
856
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
+ }
866
let mut guard: usize = 0;
867
let mut size = crate::mem::size_of_val(&guard);
868
let oid = crate::ffi::CStr::from_bytes_with_nul(b"security.bsd.stack_guard_page\0")
869
.unwrap();
- let res = libc::sysctlbyname(
870
+ let res = sysctlbyname(
871
oid.as_ptr(),
872
&mut guard as *mut _ as *mut _,
873
&mut size as *mut _ as *mut _,
0 commit comments