Inspiration
Porting a Linux C/C++ service to QNX 8.0 is archaeology. The reference set is thousands of pages, the differences are scattered across the C Library Reference, io-sock and the Neutrino guide, and the first honest feedback usually arrives at link time. I wanted the answer before the port starts: which of the 40-odd API differences does this tree hit, what do I replace them with, and how much work is it?
What it does
PortScout is a host-side CLI with three commands.
portscout scan PATH matches a C/C++ tree against 43 rules covering QNX SDP 8.0 differences (event notification, threads/process, filesystem I/O, headers/macros, build system). Findings are grouped into families, so #include <sys/epoll.h> + epoll_create() + epoll_wait() is one decision, not three. Output: text, JSON (schema-versioned), SARIF 2.1.0 for GitHub code scanning, or a single self-contained HTML report.
portscout rules --audit treats each rule as a claim with a checkable source: a name in the harvested QNX 8.0 API inventory (1,880 C Library Reference entries plus 242 from other QNX books), a verbatim quote from a QNX page, a documented survey, or an explicit needs_verification. The audit fails the build if a rule stops being true.
portscout generate PATH writes qnx/build/ for qcc: architecture, include paths, libraries, a runtime probe, and a porting-notes file. Generated files carry a marker and are skipped by the scanner, so scan → generate → scan is idempotent. It never overwrites a file it did not write.
Demo corpus: examples/linux-agent, a realistic epoll daemon that scores 19/100 BLOCKED across 24 porting families.
How we built it
Evidence first. scripts/fetch_qnx_docs.py walks the 26 letter pages of the QNX 8.0 C Library Reference plus other books and builds an API-name inventory; absence is proved against that inventory, not guessed. Every rule in data/rules.yaml carries its status, severity, effort, doc URL and replacement snippet. scripts/verify_rules.py re-fetches every cited page, checks each quote still exists, and fails on drift.
Scoring is by family: readiness = 100/(1+penalty/40), penalty = sum of the worst rule per family. Doc-silent matches score zero and yield unverified, never a fake green.
100 tests cover rules and evidence, comment/string masking, the scoring curve, all four reporters, generator idempotency, CLI exit codes, and a syntax check of the generated probe against stub QNX headers. Ruff-clean, GitHub Actions CI.
Challenges
The hardest part was proving absence. A missing name in one index is not proof; it has to be missing from every QNX 8.0 book we harvested, and the harvest itself must be tested. The second was false positives: a naive checker flags inotify, but QNX documents it via -lfsnotify and fsevmgr. That became a presence rule that prevents the false positive.
What's next
More QNX books in the harvest, a rule-authoring guide, and a QEMU target profile once an SDP is available in CI. The nine needs_verification rules stay at zero until a real target can run the probe.
Built with
Python, QNX SDP 8.0 documentation, qcc, SARIF, HTML, pytest, ruff, GitHub Actions.
Repo: https://github.com/afei8732-hub/qnx-portscout (Apache-2.0). QNX is a trademark of BlackBerry Limited; PortScout is an independent project, not affiliated with or endorsed by BlackBerry/QNX.
Built With
- cli
- developer-tools
- python
- qnx
- qnx-sdp-8.0
- sarif
- static-analysis