From 47ae2c7f1a3f3e47c47d59e5e2840d4ed43b3453 Mon Sep 17 00:00:00 2001 From: Florian Gilcher Date: Wed, 14 Oct 2026 05:23:00 +0000 Subject: [PATCH] Support QNX 8 (target_os = "qnx") QNX SDP 8.0 targets report target_os = "qnx" (QNX 7.x: "nto"). Its libc exports __get_errno_ptr like nto, not __errno_location; without this, binaries fail to link. --- src/unix.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/unix.rs b/src/unix.rs index f917518..fc43b26 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -102,7 +102,10 @@ extern "C" { link_name = "__errno_location" )] #[cfg_attr(target_os = "aix", link_name = "_Errno")] - #[cfg_attr(target_os = "nto", link_name = "__get_errno_ptr")] + #[cfg_attr( + any(target_os = "nto", target_os = "qnx"), + link_name = "__get_errno_ptr" + )] // Newer libc versions re-export `c_int` from `std` which is incompatible // with Rust < 1.64. However, this is not actually a problem as users can // use an older `libc`.