From 1ec756558b53447a6520cdfae32b9a294c111772 Mon Sep 17 00:00:00 2001 From: Carmen Donnelly Date: Tue, 24 Nov 2026 11:50:35 +0100 Subject: [PATCH 1/4] use use_file on qnx8 --- Cargo.toml | 2 +- src/backends.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index bac8a369..98d9849b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ libc = { version = "0.2.176", default-features = false } libc = { version = "0.2.190", default-features = false } # use_file -[target.'cfg(any(target_os = "haiku", target_os = "nto", target_os = "aix"))'.dependencies] +[target.'cfg(any(target_os = "haiku", target_os = "nto", target_os = "aix", target_os = "qnx"))'.dependencies] libc = { version = "0.2.176", default-features = false } # vxworks diff --git a/src/backends.rs b/src/backends.rs index 7db5022e..cceb72b2 100644 --- a/src/backends.rs +++ b/src/backends.rs @@ -45,6 +45,7 @@ cfg_if! { target_os = "haiku", target_os = "nto", target_os = "aix", + target_os = "qnx", ))] { mod use_file; pub use use_file::*; From 5060e3fd7f3b8fe5e0e67902b716fb9bc1dd5372 Mon Sep 17 00:00:00 2001 From: Carmen Donnelly Date: Wed, 2 Dec 2026 10:12:29 +0100 Subject: [PATCH 2/4] add get_errno cfg --- src/utils/get_errno.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/get_errno.rs b/src/utils/get_errno.rs index 28c231d4..22dd2a73 100644 --- a/src/utils/get_errno.rs +++ b/src/utils/get_errno.rs @@ -9,7 +9,7 @@ cfg_if! { use libc::__error as errno_location; } else if #[cfg(target_os = "haiku")] { use libc::_errnop as errno_location; - } else if #[cfg(target_os = "nto")] { + } else if #[cfg(any(target_os = "nto", target_os = "qnx"))] { use libc::__get_errno_ptr as errno_location; } else if #[cfg(any(all(target_os = "horizon", target_arch = "arm"), target_os = "vita"))] { unsafe extern "C" { From 9f2bb7ac16b5934d7c373ccb0bc1c14d7aee13e2 Mon Sep 17 00:00:00 2001 From: Carmen Donnelly Date: Wed, 2 Dec 2026 10:19:36 +0100 Subject: [PATCH 3/4] add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Артём Павлов [Artyom Pavlov] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7c34b9..d649ad7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.4.4] - UNRELEASED ### Added - Apache NuttX support ([#861]) +- Support for `target_os = "qnx"` via the `use_file` backend ([#884]) ### Fixed - Deprecation warning for `libc::INT_MAX` [#868] From 3f055e373784d5109153805107dac7ac4dae19f7 Mon Sep 17 00:00:00 2001 From: Carmen Donnelly Date: Wed, 2 Dec 2026 10:24:52 +0100 Subject: [PATCH 4/4] update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e1456cfa..59071802 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ fn get_random_u128() -> Result { | ESP-IDF | `*‑espidf` | [`esp_fill_random`] WARNING: see "Early Boot" section below | PS Vita | `*-vita-*` | [`getentropy`][19] | QNX Neutrino | `*‑nto-qnx*` | [`/dev/urandom`][14] (identical to `/dev/random`) +| QNX SDP 8.0 | `*-qnx` | [`/dev/urandom`][21] (identical to `/dev/random`) | AIX | `*-ibm-aix` | [`/dev/urandom`][15] | Cygwin | `*-cygwin` | [`getrandom`][20] (based on [`RtlGenRandom`]) | Motor OS | `x86_64-unknown-motor` | [`RDRAND`] @@ -374,6 +375,7 @@ dual licensed as above, without any additional terms or conditions. [18]: https://github.com/rust3ds/shim-3ds/commit/b01d2568836dea2a65d05d662f8e5f805c64389d [19]: https://github.com/vitasdk/newlib/blob/2d869fe47aaf02b8e52d04e9a2b79d5b210fd016/newlib/libc/sys/vita/getentropy.c [20]: https://github.com/cygwin/cygwin/blob/main/winsup/cygwin/libc/getentropy.cc +[21]: https://www.qnx.com/developers/docs/8.0/com.qnx.doc.security.system/topic/manual/dev_random.html [`ProcessPrng`]: https://learn.microsoft.com/en-us/windows/win32/seccng/processprng [`RtlGenRandom`]: https://learn.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom