Skip to content

Commit ffdd97f

Browse files
committed
further changes from feedback
1 parent 7ff3bad commit ffdd97f

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

library/std/src/sys/pal/unix/thread.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -803,28 +803,10 @@ pub mod guard {
803803
Some(stack_ptr.with_addr(stackaddr))
804804
}
805805

806-
#[cfg(target_os = "netbsd")]
807-
unsafe fn get_stack_start() -> Option<*mut libc::c_void> {
808-
let mut ret = None;
809-
let mut attr: libc::pthread_attr_t = crate::mem::zeroed();
810-
let e = libc::pthread_getattr_np(libc::pthread_self(), &mut attr);
811-
if e == 0 {
812-
let mut stackaddr = crate::ptr::null_mut();
813-
let mut stacksize = 0;
814-
let mut guardsize = 0;
815-
assert_eq!(libc::pthread_attr_getstack(&attr, &mut stackaddr, &mut stacksize), 0);
816-
// on netbsd, we need to take in account the guard size to push up
817-
// the stack's address from the bottom.
818-
assert_eq!(libc::pthread_attr_getguardsize(&attr, &mut guardsize), 0);
819-
stackaddr = stackaddr.add(guardsize);
820-
ret = Some(stackaddr);
821-
}
822-
ret
823-
}
824-
825806
#[cfg(any(
826807
target_os = "android",
827808
target_os = "freebsd",
809+
target_os = "netbsd",
828810
target_os = "hurd",
829811
target_os = "linux",
830812
target_os = "l4re"

0 commit comments

Comments
 (0)