about summary refs log tree commit diff
path: root/library/std/src/sys/pal/unix/thread.rs
diff options
context:
space:
mode:
author王宇逸 <Strawberry_Str@hotmail.com>2024-12-26 16:52:54 +0900
committer王宇逸 <Strawberry_Str@hotmail.com>2025-03-10 21:23:31 +0800
commitc9ccec93fa5e87f1363f0ce6edc897340e8c3884 (patch)
treea1ffb9dc01993eeeb09e71a164288b2e5b2c04ea /library/std/src/sys/pal/unix/thread.rs
parent2b285cd5f0877e30ad1d83e04f8cc46254e43391 (diff)
downloadrust-c9ccec93fa5e87f1363f0ce6edc897340e8c3884.tar.gz
rust-c9ccec93fa5e87f1363f0ce6edc897340e8c3884.zip
Initial STD support for Cygwin
Signed-off-by: Ookiineko <chiisaineko@protonmail.com>
Diffstat (limited to 'library/std/src/sys/pal/unix/thread.rs')
-rw-r--r--library/std/src/sys/pal/unix/thread.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs
index 11f6998cac1..4397cb69a09 100644
--- a/library/std/src/sys/pal/unix/thread.rs
+++ b/library/std/src/sys/pal/unix/thread.rs
@@ -137,7 +137,8 @@ impl Thread {
         target_os = "linux",
         target_os = "freebsd",
         target_os = "dragonfly",
-        target_os = "nuttx"
+        target_os = "nuttx",
+        target_os = "cygwin"
     ))]
     pub fn set_name(name: &CStr) {
         unsafe {
@@ -343,6 +344,7 @@ impl Drop for Thread {
     target_os = "illumos",
     target_os = "vxworks",
     target_vendor = "apple",
+    target_os = "cygwin",
 ))]
 fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] {
     let mut result = [0; MAX_WITH_NUL];
@@ -362,6 +364,7 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
             target_os = "linux",
             target_os = "aix",
             target_vendor = "apple",
+            target_os = "cygwin",
         ))] {
             #[allow(unused_assignments)]
             #[allow(unused_mut)]