Skip to content

Commit 72ee3fd

Browse files
committed
enable flock on android
1 parent 3d9c69b commit 72ee3fd

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
@@ -6,6 +6,7 @@ use rand::RngCore;
66
target_os = "linux",
77
target_os = "netbsd",
88
target_os = "illumos",
9+
target_os = "android",
910
target_vendor = "apple",
1011
))]
1112
use crate::assert_matches::assert_matches;
@@ -16,6 +17,7 @@ use crate::char::MAX_LEN_UTF8;
1617
target_os = "linux",
1718
target_os = "netbsd",
1819
target_os = "illumos",
20+
target_os = "android",
1921
target_vendor = "apple",
2022
))]
2123
use crate::fs::TryLockError;
@@ -230,6 +232,7 @@ fn file_test_io_seek_and_write() {
230232
target_os = "netbsd",
231233
target_os = "solaris",
232234
target_os = "illumos",
235+
target_os = "android",
233236
target_vendor = "apple",
234237
))]
235238
fn file_lock_multiple_shared() {
@@ -255,6 +258,7 @@ fn file_lock_multiple_shared() {
255258
target_os = "netbsd",
256259
target_os = "solaris",
257260
target_os = "illumos",
261+
target_os = "android",
258262
target_vendor = "apple",
259263
))]
260264
fn file_lock_blocking() {
@@ -281,6 +285,7 @@ fn file_lock_blocking() {
281285
target_os = "netbsd",
282286
target_os = "solaris",
283287
target_os = "illumos",
288+
target_os = "android",
284289
target_vendor = "apple",
285290
))]
286291
fn file_lock_drop() {
@@ -304,6 +309,7 @@ fn file_lock_drop() {
304309
target_os = "netbsd",
305310
target_os = "solaris",
306311
target_os = "illumos",
312+
target_os = "android",
307313
target_vendor = "apple",
308314
))]
309315
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
@@ -1293,6 +1293,7 @@ impl File {
12931293
target_os = "openbsd",
12941294
target_os = "cygwin",
12951295
target_os = "illumos",
1296+
target_os = "android",
12961297
target_vendor = "apple",
12971298
))]
12981299
pub fn lock(&self) -> io::Result<()> {
@@ -1318,6 +1319,7 @@ impl File {
13181319
target_os = "cygwin",
13191320
target_os = "solaris",
13201321
target_os = "illumos",
1322+
target_os = "android",
13211323
target_vendor = "apple",
13221324
)))]
13231325
pub fn lock(&self) -> io::Result<()> {
@@ -1332,6 +1334,7 @@ impl File {
13321334
target_os = "openbsd",
13331335
target_os = "cygwin",
13341336
target_os = "illumos",
1337+
target_os = "android",
13351338
target_vendor = "apple",
13361339
))]
13371340
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1357,6 +1360,7 @@ impl File {
13571360
target_os = "cygwin",
13581361
target_os = "solaris",
13591362
target_os = "illumos",
1363+
target_os = "android",
13601364
target_vendor = "apple",
13611365
)))]
13621366
pub fn lock_shared(&self) -> io::Result<()> {
@@ -1371,6 +1375,7 @@ impl File {
13711375
target_os = "openbsd",
13721376
target_os = "cygwin",
13731377
target_os = "illumos",
1378+
target_os = "android",
13741379
target_vendor = "apple",
13751380
))]
13761381
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1412,6 +1417,7 @@ impl File {
14121417
target_os = "cygwin",
14131418
target_os = "solaris",
14141419
target_os = "illumos",
1420+
target_os = "android",
14151421
target_vendor = "apple",
14161422
)))]
14171423
pub fn try_lock(&self) -> Result<(), TryLockError> {
@@ -1429,6 +1435,7 @@ impl File {
14291435
target_os = "openbsd",
14301436
target_os = "cygwin",
14311437
target_os = "illumos",
1438+
target_os = "android",
14321439
target_vendor = "apple",
14331440
))]
14341441
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1470,6 +1477,7 @@ impl File {
14701477
target_os = "cygwin",
14711478
target_os = "solaris",
14721479
target_os = "illumos",
1480+
target_os = "android",
14731481
target_vendor = "apple",
14741482
)))]
14751483
pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
@@ -1487,6 +1495,7 @@ impl File {
14871495
target_os = "openbsd",
14881496
target_os = "cygwin",
14891497
target_os = "illumos",
1498+
target_os = "android",
14901499
target_vendor = "apple",
14911500
))]
14921501
pub fn unlock(&self) -> io::Result<()> {
@@ -1512,6 +1521,7 @@ impl File {
15121521
target_os = "cygwin",
15131522
target_os = "solaris",
15141523
target_os = "illumos",
1524+
target_os = "android",
15151525
target_vendor = "apple",
15161526
)))]
15171527
pub fn unlock(&self) -> io::Result<()> {

0 commit comments

Comments
 (0)