@@ -1310,7 +1310,7 @@ fn test_getpeereid_invalid_fd() {
13101310}
13111311
13121312#[ test]
1313- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1313+ #[ cfg( not( target_os = "redox" ) ) ]
13141314fn test_faccessat_none_not_existing ( ) {
13151315 use nix:: fcntl:: AtFlags ;
13161316 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1324,7 +1324,7 @@ fn test_faccessat_none_not_existing() {
13241324}
13251325
13261326#[ test]
1327- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1327+ #[ cfg( not( target_os = "redox" ) ) ]
13281328fn test_faccessat_not_existing ( ) {
13291329 use nix:: fcntl:: AtFlags ;
13301330 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1344,7 +1344,7 @@ fn test_faccessat_not_existing() {
13441344}
13451345
13461346#[ test]
1347- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1347+ #[ cfg( not( target_os = "redox" ) ) ]
13481348fn test_faccessat_none_file_exists ( ) {
13491349 use nix:: fcntl:: AtFlags ;
13501350 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1360,7 +1360,7 @@ fn test_faccessat_none_file_exists() {
13601360}
13611361
13621362#[ test]
1363- #[ cfg( not( any ( target_os = "illumos" , target_os = " redox") ) ) ]
1363+ #[ cfg( not( target_os = "redox" ) ) ]
13641364fn test_faccessat_file_exists ( ) {
13651365 use nix:: fcntl:: AtFlags ;
13661366 let tempdir = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -1376,3 +1376,32 @@ fn test_faccessat_file_exists() {
13761376 )
13771377 . is_ok( ) ) ;
13781378}
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