about summary refs log tree commit diff
diff options
context:
space:
mode:
author王宇逸 <Strawberry_Str@hotmail.com>2025-08-21 01:06:51 +0800
committer王宇逸 <Strawberry_Str@hotmail.com>2025-08-21 01:06:51 +0800
commitcadb56d92e596d4922dda253e3ca374b0479627c (patch)
tree0e6c64677a8e2a29277f9112540e12ad46d10620
parente8a792daf500b5ff8097896ddb6cc037abe92487 (diff)
downloadrust-cadb56d92e596d4922dda253e3ca374b0479627c.tar.gz
rust-cadb56d92e596d4922dda253e3ca374b0479627c.zip
Add flock support for cygwin
-rw-r--r--library/std/src/sys/fs/unix.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs
index 7ee9f3c445a..0d710a4b2a6 100644
--- a/library/std/src/sys/fs/unix.rs
+++ b/library/std/src/sys/fs/unix.rs
@@ -1265,6 +1265,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     ))]
     pub fn lock(&self) -> io::Result<()> {
@@ -1278,6 +1279,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     )))]
     pub fn lock(&self) -> io::Result<()> {
@@ -1290,6 +1292,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     ))]
     pub fn lock_shared(&self) -> io::Result<()> {
@@ -1303,6 +1306,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     )))]
     pub fn lock_shared(&self) -> io::Result<()> {
@@ -1315,6 +1319,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     ))]
     pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1336,6 +1341,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     )))]
     pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1351,6 +1357,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     ))]
     pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1372,6 +1379,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     )))]
     pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1387,6 +1395,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     ))]
     pub fn unlock(&self) -> io::Result<()> {
@@ -1400,6 +1409,7 @@ impl File {
         target_os = "linux",
         target_os = "netbsd",
         target_os = "openbsd",
+        target_os = "cygwin",
         target_vendor = "apple",
     )))]
     pub fn unlock(&self) -> io::Result<()> {