diff options
| author | beetrees <b@beetr.ee> | 2024-04-12 22:44:25 +0100 |
|---|---|---|
| committer | beetrees <b@beetr.ee> | 2024-04-13 01:16:28 +0100 |
| commit | 53f55c6635d746613eb1ceb879d58f8e3da97057 (patch) | |
| tree | a828f7d5981ebef055f6206a64fa35d1984b765e | |
| parent | b3bd7058c139e71bae0862ef8f8ac936208873e9 (diff) | |
| download | rust-53f55c6635d746613eb1ceb879d58f8e3da97057.tar.gz rust-53f55c6635d746613eb1ceb879d58f8e3da97057.zip | |
Add missing `unsafe` to internal function `std::sys::pal::unix::thread::min_stack_size`
| -rw-r--r-- | library/std/src/sys/pal/unix/thread.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs index f56e64c3505..c550cc04a39 100644 --- a/library/std/src/sys/pal/unix/thread.rs +++ b/library/std/src/sys/pal/unix/thread.rs @@ -709,7 +709,7 @@ mod cgroups { // is created in an application with big thread-local storage requirements. // See #6233 for rationale and details. #[cfg(all(target_os = "linux", target_env = "gnu"))] -fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize { +unsafe fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize { // We use dlsym to avoid an ELF version dependency on GLIBC_PRIVATE. (#23628) // We shouldn't really be using such an internal symbol, but there's currently // no other way to account for the TLS size. @@ -723,11 +723,11 @@ fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize { // No point in looking up __pthread_get_minstack() on non-glibc platforms. #[cfg(all(not(all(target_os = "linux", target_env = "gnu")), not(target_os = "netbsd")))] -fn min_stack_size(_: *const libc::pthread_attr_t) -> usize { +unsafe fn min_stack_size(_: *const libc::pthread_attr_t) -> usize { libc::PTHREAD_STACK_MIN } #[cfg(target_os = "netbsd")] -fn min_stack_size(_: *const libc::pthread_attr_t) -> usize { +unsafe fn min_stack_size(_: *const libc::pthread_attr_t) -> usize { 2048 // just a guess } |
