Skip to content

Commit

Permalink
Auto merge of rust-lang#123346 - workingjubilee:rollup-ix9qpsi, r=wor…
Browse files Browse the repository at this point in the history
…kingjubilee

Rollup of 2 pull requests

Successful merges:

 - rust-lang#123323 (std::thread: set_name change for solaris/illumos.)
 - rust-lang#123330 (Pass RUST_BACKTRACE when running docker.)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Apr 2, 2024
2 parents dd5e502 + 347c579 commit 31075bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ impl Thread {

if let Some(f) = pthread_setname_np.get() {
#[cfg(target_os = "nto")]
let name = truncate_cstr::<{ libc::_NTO_THREAD_NAME_MAX as usize }>(name);
const THREAD_NAME_MAX: usize = libc::_NTO_THREAD_NAME_MAX as usize;
#[cfg(any(target_os = "solaris", target_os = "illumos"))]
const THREAD_NAME_MAX: usize = 32;

let name = truncate_cstr::<{ THREAD_NAME_MAX }>(name);
let res = unsafe { f(libc::pthread_self(), name.as_ptr()) };
debug_assert_eq!(res, 0);
}
Expand Down Expand Up @@ -368,6 +371,8 @@ impl Drop for Thread {
target_os = "tvos",
target_os = "watchos",
target_os = "nto",
target_os = "solaris",
target_os = "illumos",
))]
fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
let mut result = [0; MAX_WITH_NUL];
Expand Down
1 change: 1 addition & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ docker \
--env GITHUB_ACTIONS \
--env GITHUB_REF \
--env GITHUB_STEP_SUMMARY="/checkout/obj/${SUMMARY_FILE}" \
--env RUST_BACKTRACE \
--env TOOLSTATE_REPO_ACCESS_TOKEN \
--env TOOLSTATE_REPO \
--env TOOLSTATE_PUBLISH \
Expand Down

0 comments on commit 31075bb

Please sign in to comment.