File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -541,13 +541,14 @@ mod test_posix_fallocate {
541
541
assert_eq ! ( tmp. read( & mut data) . expect( "read failure" ) , LEN ) ;
542
542
assert_eq ! ( & data[ ..] , & [ 0u8 ; LEN ] [ ..] ) ;
543
543
}
544
- Err ( Errno :: EINVAL ) => {
545
- // POSIX requires posix_fallocate to return EINVAL both for
546
- // invalid arguments (i.e. len < 0) and if the operation is not
547
- // supported by the file system.
548
- // There's no way to tell for sure whether the file system
549
- // supports posix_fallocate, so we must pass the test if it
550
- // returns EINVAL.
544
+ Err ( Errno :: ENOTSUP ) | Err ( Errno :: EINVAL ) => {
545
+ // POSIX 1003.1-2024 Issue 8 specified ENOTSUP for "the file
546
+ // system does not support this operation", so Nix should accept
547
+ // that error code and pass the test.
548
+ // But older POSIX required posix_fallocate to return EINVAL
549
+ // both for invalid arguments (i.e. len < 0) and if the
550
+ // operation is not supported by the file system. So we must
551
+ // also pass the test if it returns EINVAL.
551
552
}
552
553
_ => res. unwrap ( ) ,
553
554
}
You can’t perform that action at this time.
0 commit comments