diff options
| author | Ralf Jung <post@ralfj.de> | 2023-06-22 10:39:19 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-06-22 10:39:19 +0200 |
| commit | 940cd59e39ce06bcacda3d342b97f28761555ba5 (patch) | |
| tree | 8b2cc6943f54a3a3d4dab4ca9fd6c8a899543427 /library/std/src/sys/unix/thread.rs | |
| parent | 2bd9ade66e28a1fa5c6609d12cd8461cfa36d809 (diff) | |
| parent | 0faea7728f283dca5693f79be7615f67842c55dd (diff) | |
| download | rust-940cd59e39ce06bcacda3d342b97f28761555ba5.tar.gz rust-940cd59e39ce06bcacda3d342b97f28761555ba5.zip | |
Merge from rustc
Diffstat (limited to 'library/std/src/sys/unix/thread.rs')
| -rw-r--r-- | library/std/src/sys/unix/thread.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/unix/thread.rs index 010015667f7..893f8b8df3f 100644 --- a/library/std/src/sys/unix/thread.rs +++ b/library/std/src/sys/unix/thread.rs @@ -150,7 +150,7 @@ impl Thread { } } - #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos"))] + #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] pub fn set_name(name: &CStr) { unsafe { let name = truncate_cstr::<{ libc::MAXTHREADNAMESIZE }>(name); @@ -283,7 +283,13 @@ impl Drop for Thread { } } -#[cfg(any(target_os = "linux", target_os = "macos", target_os = "ios", target_os = "watchos"))] +#[cfg(any( + target_os = "linux", + target_os = "macos", + target_os = "ios", + target_os = "tvos", + target_os = "watchos", +))] fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] { let mut result = [0; MAX_WITH_NUL]; for (src, dst) in cstr.to_bytes().iter().zip(&mut result[..MAX_WITH_NUL - 1]) { @@ -299,6 +305,7 @@ pub fn available_parallelism() -> io::Result<NonZeroUsize> { target_os = "emscripten", target_os = "fuchsia", target_os = "ios", + target_os = "tvos", target_os = "linux", target_os = "macos", target_os = "solaris", |
