Skip to content

Commit 018568f

Browse files
authored
Rollup merge of #145673 - Berrysoft:cygwin-fix-flock, r=joshtriplett
Add flock support for cygwin See discussion: #145534 (comment) cc: ``@jeremyd2019``
2 parents 99c647f + cadb56d commit 018568f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/std/src/sys/fs/unix.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,7 @@ impl File {
12651265
target_os = "linux",
12661266
target_os = "netbsd",
12671267
target_os = "openbsd",
1268+
target_os = "cygwin",
12681269
target_vendor = "apple",
12691270
))]
12701271
pub fn lock(&self) -> io::Result<()> {
@@ -1278,6 +1279,7 @@ impl File {
12781279
target_os = "linux",
12791280
target_os = "netbsd",
12801281
target_os = "openbsd",
1282+
target_os = "cygwin",
12811283
target_vendor = "apple",
12821284
)))]
12831285
pub fn lock(&self) -> io::Result<()> {
@@ -1290,6 +1292,7 @@ impl File {
12901292
target_os = "linux",
12911293
target_os = "netbsd",
12921294
target_os = "openbsd",
1295+
target_os = "cygwin",
12931296
target_vendor = "apple",
12941297
))]
12951298
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1303,6 +1306,7 @@ impl File {
13031306
target_os = "linux",
13041307
target_os = "netbsd",
13051308
target_os = "openbsd",
1309+
target_os = "cygwin",
13061310
target_vendor = "apple",
13071311
)))]
13081312
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1315,6 +1319,7 @@ impl File {
13151319
target_os = "linux",
13161320
target_os = "netbsd",
13171321
target_os = "openbsd",
1322+
target_os = "cygwin",
13181323
target_vendor = "apple",
13191324
))]
13201325
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1336,6 +1341,7 @@ impl File {
13361341
target_os = "linux",
13371342
target_os = "netbsd",
13381343
target_os = "openbsd",
1344+
target_os = "cygwin",
13391345
target_vendor = "apple",
13401346
)))]
13411347
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1351,6 +1357,7 @@ impl File {
13511357
target_os = "linux",
13521358
target_os = "netbsd",
13531359
target_os = "openbsd",
1360+
target_os = "cygwin",
13541361
target_vendor = "apple",
13551362
))]
13561363
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1372,6 +1379,7 @@ impl File {
13721379
target_os = "linux",
13731380
target_os = "netbsd",
13741381
target_os = "openbsd",
1382+
target_os = "cygwin",
13751383
target_vendor = "apple",
13761384
)))]
13771385
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1387,6 +1395,7 @@ impl File {
13871395
target_os = "linux",
13881396
target_os = "netbsd",
13891397
target_os = "openbsd",
1398+
target_os = "cygwin",
13901399
target_vendor = "apple",
13911400
))]
13921401
pub fn unlock(&self) -> io::Result<()> {
@@ -1400,6 +1409,7 @@ impl File {
14001409
target_os = "linux",
14011410
target_os = "netbsd",
14021411
target_os = "openbsd",
1412+
target_os = "cygwin",
14031413
target_vendor = "apple",
14041414
)))]
14051415
pub fn unlock(&self) -> io::Result<()> {

0 commit comments

Comments
 (0)