Swatantra-66 commented on PR #22519:
URL: https://github.com/apache/nuttx/pull/22519#issuecomment-7253250480
Closing this PR after investigating the CI failures in sim-01, risc-v-05,
and x86_64-01
The test failures in test_ltp_interface_integration.py (shm_open_13_1 and
shm_open_20_1) are caused by the Open POSIX Test Suite explicitly expecting
errno == EINVAL when calling ftruncate() on a read-only descriptor:
```c
result = ftruncate(fd, BUF_SIZE);
if (result == -1 && errno == EINVAL) {
return PTS_PASS;
}
```
Re-verifying the IEEE Std 1003.1-2017 specification for ftruncate() confirms
that both errors are standard-conformant:
> [EBADF] or [EINVAL]
> The fildes argument is not a file descriptor open for writing.
Linux and glibc also return EINVAL in this scenario. Because NuttX's current
implementation (-EINVAL) is already fully compliant with POSIX and matches
Linux and LTP expectations, changing it to `-EBADF` breaks POSIX testsuite
compatibility.
the existing NuttX behavior is already correct
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]