Skip to content

Commit 5cc2d7b

Browse files
committed
Add missing unsafe to internal function std::sys::pal::unix::thread::min_stack_size
1 parent f756686 commit 5cc2d7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ mod cgroups {
709709
// is created in an application with big thread-local storage requirements.
710710
// See #6233 for rationale and details.
711711
#[cfg(all(target_os = "linux", target_env = "gnu"))]
712-
fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
712+
unsafe fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
713713
// We use dlsym to avoid an ELF version dependency on GLIBC_PRIVATE. (#23628)
714714
// We shouldn't really be using such an internal symbol, but there's currently
715715
// no other way to account for the TLS size.
@@ -723,11 +723,11 @@ fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
723723

724724
// No point in looking up __pthread_get_minstack() on non-glibc platforms.
725725
#[cfg(all(not(all(target_os = "linux", target_env = "gnu")), not(target_os = "netbsd")))]
726-
fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {
726+
unsafe fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {
727727
libc::PTHREAD_STACK_MIN
728728
}
729729

730730
#[cfg(target_os = "netbsd")]
731-
fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {
731+
unsafe fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {
732732
2048 // just a guess
733733
}

0 commit comments

Comments
 (0)