libc-test fixes for QNX targets - #5337
Merged
Merged
Conversation
tgross35
requested changes
Aug 2, 2026
Comment on lines
+285
to
+287
| pub gl_errfunc: extern "C" fn(*const c_char, c_int) -> c_int, | ||
| pub gl_errfunc: Option<extern "C" fn(*const c_char, c_int) -> c_int>, |
Contributor
There was a problem hiding this comment.
Since you're changing this, could you make the function unsafe as well?
Comment on lines
+583
to
+588
| __reserved0: crate::uintptr_t, | ||
| pub __policy: c_int, | ||
| pub __param: crate::__sched_param, | ||
| pub __guardsize: c_uint, | ||
| pub __prealloc: c_uint, | ||
| __reserved1: crate::uintptr_t, |
Contributor
There was a problem hiding this comment.
Wrap spare/reserved fields in Padding
| pub timer_load_max: u64, | ||
| pub boot_cc: u64, | ||
| pub tick_period_cc: u64, | ||
| spare: [u64; 3], |
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Contributor
Author
|
thanks for the review |
tgross35
approved these changes
Aug 4, 2026
This comment has been minimized.
This comment has been minimized.
these are changes required to pass `cargo test -p libc-test --test ctest` on
the QNX targets
libc-test had probably not been run before for QNX8 so quite a few things needed
fixing:
- some constants that were present in QNX7.1 are no longer present in QNX8, e.g.
`STATE_STACK`, `_NTO_CI_SANDBOX`
- the values of some constants have changed on QNX8, e.g. `FILENAME_MAX`
- some functions that were present in QNX7.1 are no longer present in QNX8, e.g
`SyncMutexRevive`
- some structs have changed ABI in QNX8, e.g. `_thread_attr`, `mallinfo`,
`pthread_rwlock_t`
- on QNX8, `inotify_*` functions now live in the `libfsnotify.so` library
- on QNX8, the neutrino API is specified in `sys/neutrino.h`
- some header files (e.g. `sys/malloc.h`, `nbutil.h`) are no longer present on
QNX8
libc-test probably had not been run in a while for QNX7.1 so there a few
small fixes there as well:
- `ctest` v0.5.x requires that bindings have named arguments but `sysctl` was
using underscores (`_`) as names; the arguments now have names
- `BPF_{MOD,XOR}` are only defined in `pcap/bpf.h` but the header file cannot
be included together with `net/bpf.h` due to `ifdef` include guards on the
C side and `ctest` only generating a single test binary. These constants
can't be tested by `ctest` on QNX7.1, so they have been added to the
skip list
- `ctest` does not support anonymous unions so the `ifr_ifru` field in the
`ifreq` struct needs to be skipped
- the `timezone` struct must be skipped as it's an `extern_ty!`pe
these are based on `unix.txt` without the API not present on QNX note that `qnx.txt` has extra API that is not present in `nto.txt`, like `SA_ONSTACK` and `cfsetspeed` with this change the entirity of `libc-test`'s tests pass on QNX targets
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Contributor
Author
|
squashed and rebased |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We started running libc-test for the QNX targets as part of Ferrocene CI (ferrocene/ferrocene#2512) and noticed that the
ctestandsemvertests were failing. This PR upstreams our fixes. See the commit messages for details about the changes.Checklist
libc-test/semverhave been updated. ➡️ Initial semver files added*LASTor*MAXhave the standarddoc comment. ➡️ N/A no new constant with these names have been added
cargo test -p libc-test --target mytarget);especially relevant for platforms that may not be checked in CI. ➡️ Done for QNX7.1 and QNX8, both x86_64 and aarch64
@rustbot label +stable-nominated