about summary refs log tree commit diff
path: root/library/std/src/sys/fs/unix.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/fs/unix.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/fs/unix.rs')
-rw-r--r--library/std/src/sys/fs/unix.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs
index 914971934bf..e99d6a07731 100644
--- a/library/std/src/sys/fs/unix.rs
+++ b/library/std/src/sys/fs/unix.rs
@@ -543,7 +543,7 @@ impl FileAttr {
         SystemTime::new(self.stat.st_atim.tv_sec as i64, self.stat.st_atim.tv_nsec as i64)
     }
 
-    #[cfg(any(target_os = "freebsd", target_os = "openbsd", target_vendor = "apple"))]
+    #[cfg(any(target_os = "freebsd", target_os = "openbsd", target_vendor = "apple", target_os = "cygwin"))]
     pub fn created(&self) -> io::Result<SystemTime> {
         SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtime_nsec as i64)
     }
@@ -553,6 +553,7 @@ impl FileAttr {
         target_os = "openbsd",
         target_os = "vita",
         target_vendor = "apple",
+        target_os = "cygwin",
     )))]
     pub fn created(&self) -> io::Result<SystemTime> {
         cfg_has_statx! {
@@ -960,6 +961,7 @@ impl DirEntry {
 
     #[cfg(any(
         target_os = "linux",
+        target_os = "cygwin",
         target_os = "emscripten",
         target_os = "android",
         target_os = "solaris",
@@ -1220,6 +1222,7 @@ impl File {
             target_os = "freebsd",
             target_os = "fuchsia",
             target_os = "linux",
+            target_os = "cygwin",
             target_os = "android",
             target_os = "netbsd",
             target_os = "openbsd",
@@ -1234,6 +1237,7 @@ impl File {
             target_os = "fuchsia",
             target_os = "freebsd",
             target_os = "linux",
+            target_os = "cygwin",
             target_os = "netbsd",
             target_os = "openbsd",
             target_os = "nto",