Skip to content

Commit 1a7eff4

Browse files
committed
enable flock for illumos
1 parent f8297e3 commit 1a7eff4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

library/std/src/fs/tests.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use rand::RngCore;
55
target_os = "freebsd",
66
target_os = "linux",
77
target_os = "netbsd",
8+
target_os = "illumos",
89
target_vendor = "apple",
910
))]
1011
use crate::assert_matches::assert_matches;
@@ -14,6 +15,7 @@ use crate::char::MAX_LEN_UTF8;
1415
target_os = "freebsd",
1516
target_os = "linux",
1617
target_os = "netbsd",
18+
target_os = "illumos",
1719
target_vendor = "apple",
1820
))]
1921
use crate::fs::TryLockError;
@@ -227,6 +229,7 @@ fn file_test_io_seek_and_write() {
227229
target_os = "linux",
228230
target_os = "netbsd",
229231
target_os = "solaris",
232+
target_os = "illumos",
230233
target_vendor = "apple",
231234
))]
232235
fn file_lock_multiple_shared() {
@@ -251,6 +254,7 @@ fn file_lock_multiple_shared() {
251254
target_os = "linux",
252255
target_os = "netbsd",
253256
target_os = "solaris",
257+
target_os = "illumos",
254258
target_vendor = "apple",
255259
))]
256260
fn file_lock_blocking() {
@@ -276,6 +280,7 @@ fn file_lock_blocking() {
276280
target_os = "linux",
277281
target_os = "netbsd",
278282
target_os = "solaris",
283+
target_os = "illumos",
279284
target_vendor = "apple",
280285
))]
281286
fn file_lock_drop() {
@@ -298,6 +303,7 @@ fn file_lock_drop() {
298303
target_os = "linux",
299304
target_os = "netbsd",
300305
target_os = "solaris",
306+
target_os = "illumos",
301307
target_vendor = "apple",
302308
))]
303309
fn file_lock_dup() {

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,7 @@ impl File {
12861286
target_os = "netbsd",
12871287
target_os = "openbsd",
12881288
target_os = "cygwin",
1289+
target_os = "illumos",
12891290
target_vendor = "apple",
12901291
))]
12911292
pub fn lock(&self) -> io::Result<()> {
@@ -1310,6 +1311,7 @@ impl File {
13101311
target_os = "openbsd",
13111312
target_os = "cygwin",
13121313
target_os = "solaris",
1314+
target_os = "illumos",
13131315
target_vendor = "apple",
13141316
)))]
13151317
pub fn lock(&self) -> io::Result<()> {
@@ -1323,6 +1325,7 @@ impl File {
13231325
target_os = "netbsd",
13241326
target_os = "openbsd",
13251327
target_os = "cygwin",
1328+
target_os = "illumos",
13261329
target_vendor = "apple",
13271330
))]
13281331
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1347,6 +1350,7 @@ impl File {
13471350
target_os = "openbsd",
13481351
target_os = "cygwin",
13491352
target_os = "solaris",
1353+
target_os = "illumos",
13501354
target_vendor = "apple",
13511355
)))]
13521356
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1360,6 +1364,7 @@ impl File {
13601364
target_os = "netbsd",
13611365
target_os = "openbsd",
13621366
target_os = "cygwin",
1367+
target_os = "illumos",
13631368
target_vendor = "apple",
13641369
))]
13651370
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1400,6 +1405,7 @@ impl File {
14001405
target_os = "openbsd",
14011406
target_os = "cygwin",
14021407
target_os = "solaris",
1408+
target_os = "illumos",
14031409
target_vendor = "apple",
14041410
)))]
14051411
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1416,6 +1422,7 @@ impl File {
14161422
target_os = "netbsd",
14171423
target_os = "openbsd",
14181424
target_os = "cygwin",
1425+
target_os = "illumos",
14191426
target_vendor = "apple",
14201427
))]
14211428
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1456,6 +1463,7 @@ impl File {
14561463
target_os = "openbsd",
14571464
target_os = "cygwin",
14581465
target_os = "solaris",
1466+
target_os = "illumos",
14591467
target_vendor = "apple",
14601468
)))]
14611469
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1472,6 +1480,7 @@ impl File {
14721480
target_os = "netbsd",
14731481
target_os = "openbsd",
14741482
target_os = "cygwin",
1483+
target_os = "illumos",
14751484
target_vendor = "apple",
14761485
))]
14771486
pub fn unlock(&self) -> io::Result<()> {
@@ -1496,6 +1505,7 @@ impl File {
14961505
target_os = "openbsd",
14971506
target_os = "cygwin",
14981507
target_os = "solaris",
1508+
target_os = "illumos",
14991509
target_vendor = "apple",
15001510
)))]
15011511
pub fn unlock(&self) -> io::Result<()> {

0 commit comments

Comments
 (0)