Inspiration
Zenoh is a pub/sub, query and storage protocol that robotics uses as a ROS 2 middleware (rmw_zenoh), and that automotive and industrial teams use to move data between small devices, gateways and the cloud. Those are QNX's markets, but on 4 Nov 2026 I found no QNX support for zenoh-pico anywhere: not on repo.oss.qnx.com, not in the QNX open-source ports project, and no mention in the upstream code. A QNX controller that wants to publish its data to a Zenoh network had no client to do it with.
What it does
A QNX 8.0 program links libzenohpico.so and can then publish, subscribe, query and answer queries against Zenoh routers and peers on any other system.
- No fork. zenoh-pico 1.10.2 can load a platform from outside its source tree as a CMake package. The port is such a package,
zenohpico-qnx, plus a two-line patch.build.shfetches the pinned upstream release, applies the patch and builds it unchanged otherwise. - The
qnxplatform profile builds zenoh-pico's own unix system layer and POSIX transports (TCP, UDP unicast and multicast, serial) with BSD semantics, because QNX 8.0's network stack, io-sock, comes from FreeBSD (SO_NOSIGPIPE,getifaddrs). It links QNX'ssocketlibrary andm. - Random bytes for QNX. zenoh-pico needs
arc4randomfor session ids, and QNX's libc has nogetrandom,getentropyorarc4random. The port provides them from/dev/urandom. On QNX everyread()is a message to therandomresource manager, and zenoh-pico asks for a few bytes at a time, so small requests come from a 4 KiB pool that one read fills. Each byte is handed out once and then wiped, the child of afork()starts with an empty pool, and if the device cannot be read the process aborts rather than hand out predictable ids. - A usable package. It installs headers, the library and a CMake config, so a QNX project needs only
find_package(zenohpico)andtarget_link_libraries(my_app PRIVATE zenohpico::lib). A downstream consumer built this way runs on the target. - Tests on the target.
test/run-on-qnx.shcopies zenoh-pico's own test suite to a QNX target over ssh and runs it;test/interop.shchecks a QNX program against the reference Rust router, zenohd, and a Linux peer.
Results on QNX 8.0 (x86_64, QEMU with KVM)
- The library, 32 examples and 40 tests build.
- 41 of 41 tests pass on the target: zenoh-pico's 40 and the port's own random test.
- Interoperability with zenohd 1.10.2 and zenoh-pico on Linux, 4 of 4 checks: the QNX session sees the router; QNX publishes to Linux (5 of 5 messages arrive); Linux publishes to QNX (4 of 4); a Linux query is answered by a QNX queryable.
- aarch64le builds with the same script. It has not run on an aarch64 target yet.
How I built it
- QNX SDP 8.0 in WSL 2 Ubuntu 24.04, CMake 3.28 and Ninja, the SDP's GCC drivers (
x86_64-pc-nto-qnx8.0.0-gcc,aarch64-unknown-nto-qnx8.0.0-gcc) throughcmake/qnx-toolchain.cmake. - Target: a mkqnximage image under QEMU with KVM, with sshd,
randomand io-sock running. Test binaries and the library go over scp to/data/zp; each test runs undertimeoutand its log is kept in/dev/shmem. - Interop: zenohd 1.10.2 from the Eclipse release, a Linux build of the same zenoh-pico, and the QNX guest reaching the host through QEMU's user network.
The files that show the QNX connection
zenohpico-qnx/cmake/platforms/qnx.cmake: theqnxplatform profile (BSD socket semantics for io-sock,socketandmlibraries).zenohpico-qnx/src/random_qnx.c:arc4randomandarc4random_buffor QNX from therandomresource manager, pooled, fork-safe.zenohpico-qnx/include/zenoh_qnx_platform.h: the platform header zenoh-pico includes for QNX.patches/0001-transport-include-sys-socket.h.patch: the upstream change QNX's headers need.cmake/qnx-toolchain.cmake: CMake toolchain for the QNX 8.0 GCC drivers, x86_64 and aarch64le.test/results-x86_64.mdandtest/interop-x86_64.md: the runs on the QNX target.
Challenges
qccpasses-pipeon to cc1, and zenoh-pico's release flags use it, so the build failed inside the compiler. The toolchain calls the SDP's GCC drivers directly.- Two upstream files used
AF_INETandstruct lingerwithout including<sys/socket.h>. glibc pulls it in through<netdb.h>; QNX's headers do not. The fix is a two-line patch meant for upstream. isinf()in QNX's<math.h>is a call into libm, not a compiler builtin, so the profile linksm.- Upstream's
z_msgcodec_testasks for random bytes constantly. Unpooled, it ran past the test runner's timeout on the target; pooled, it passes. - The test log of that one test is tens of megabytes and the image's
/datapartition is small, so logs go to RAM and only their tail is kept.
What I learned
- On QNX, a device read is message passing to a server, so the cost of a call depends on how often you make it, not on how many bytes you ask for. That shaped the random pool.
- zenoh-pico's out-of-tree platform mechanism makes a port possible without forking. A port can then be reviewed as a package plus one small patch.
What's next
- Send the
<sys/socket.h>patch upstream, and offer the profile as a built-inqnxplatform. - Run on aarch64: QEMU virt and Raspberry Pi 4 and 5.
- A QNX example that publishes resource manager or sensor data to a Zenoh network.