@@ -1310,7 +1310,7 @@ fn test_getpeereid_invalid_fd() {
1310
1310
}
1311
1311
1312
1312
#[ test]
1313
- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1313
+ #[ cfg( not( target_os = "redox" ) ) ]
1314
1314
fn test_faccessat_none_not_existing ( ) {
1315
1315
use nix:: fcntl:: AtFlags ;
1316
1316
let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1324,7 +1324,7 @@ fn test_faccessat_none_not_existing() {
1324
1324
}
1325
1325
1326
1326
#[ test]
1327
- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1327
+ #[ cfg( not( target_os = "redox" ) ) ]
1328
1328
fn test_faccessat_not_existing ( ) {
1329
1329
use nix:: fcntl:: AtFlags ;
1330
1330
let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1344,7 +1344,7 @@ fn test_faccessat_not_existing() {
1344
1344
}
1345
1345
1346
1346
#[ test]
1347
- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1347
+ #[ cfg( not( target_os = "redox" ) ) ]
1348
1348
fn test_faccessat_none_file_exists ( ) {
1349
1349
use nix:: fcntl:: AtFlags ;
1350
1350
let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1360,7 +1360,7 @@ fn test_faccessat_none_file_exists() {
1360
1360
}
1361
1361
1362
1362
#[ test]
1363
- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1363
+ #[ cfg( not( target_os = "redox" ) ) ]
1364
1364
fn test_faccessat_file_exists ( ) {
1365
1365
use nix:: fcntl:: AtFlags ;
1366
1366
let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1376,3 +1376,32 @@ fn test_faccessat_file_exists() {
1376
1376
)
1377
1377
. is_ok( ) ) ;
1378
1378
}
1379
+
1380
+ #[ test]
1381
+ #[ cfg( any(
1382
+ all( target_os = "linux" , not( target_env = "uclibc" ) ) ,
1383
+ target_os = "freebsd" ,
1384
+ target_os = "dragonfly"
1385
+ ) ) ]
1386
+ fn test_eaccess_not_existing ( ) {
1387
+ let tempdir = tempdir ( ) . unwrap ( ) ;
1388
+ let dir = tempdir. path ( ) . join ( "does_not_exist.txt" ) ;
1389
+ assert_eq ! (
1390
+ eaccess( & dir, AccessFlags :: F_OK ) . err( ) . unwrap( ) ,
1391
+ Errno :: ENOENT
1392
+ ) ;
1393
+ }
1394
+
1395
+ #[ test]
1396
+ #[ cfg( any(
1397
+ all( target_os = "linux" , not( target_env = "uclibc" ) ) ,
1398
+ target_os = "freebsd" ,
1399
+ target_os = "dragonfly"
1400
+ ) ) ]
1401
+ fn test_eaccess_file_exists ( ) {
1402
+ let tempdir = tempdir ( ) . unwrap ( ) ;
1403
+ let path = tempdir. path ( ) . join ( "does_exist.txt" ) ;
1404
+ let _file = File :: create ( path. clone ( ) ) . unwrap ( ) ;
1405
+ eaccess ( & path, AccessFlags :: R_OK | AccessFlags :: W_OK )
1406
+ . expect ( "assertion failed" ) ;
1407
+ }
0 commit comments