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] 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/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 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::*; 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" {