TCP_KEEPALIVE and LOCAL_PEEREID are defined in the nto70/nto71 branch of src/unix/nto/mod.rs (lines 919 and 967), but missing from the else branch that covers nto80 (QNX 8.0). This causes compilation failures for crates like
socket2 and tokio when targeting aarch64-unknown-nto-qnx800.
Target triple: aarch64-unknown-nto-qnx800
Minimum reproduction:
// main.rs — no dependencies other than libc
extern crate libc;
fn main() {
let _ = libc::TCP_KEEPALIVE; // error[E0432]: no TCP_KEEPALIVE in the root
let _ = libc::LOCAL_PEEREID; // error[E0432]: no LOCAL_PEEREID in the root
}
Cargo.toml
[package]
name = "libc-qnx800-repro"
version = "0.1.0"
edition = "2021"
[dependencies]
libc = "0.2.185"
cargo build --target aarch64-unknown-nto-qnx800
Build log (trimmed):
error[E0432]: unresolved import libc::TCP_KEEPALIVE
--> /root/.cargo/registry/src/index.crates.io-.../socket2-0.5.10/src/sys/unix.rs:291:5
|
291 | use libc::TCP_KEEPALIVE as KEEPALIVE_TIME;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no TCP_KEEPALIVE in the root
error[E0432]: unresolved import libc::LOCAL_PEEREID
--> /root/.cargo/registry/src/index.crates.io-.../tokio-1.42.1/src/net/unix/ucred.rs:127:56
|
127 | use libc::{c_void, getsockopt, socklen_t, unpcbid, LOCAL_PEEREID, SOL_SOCKET};
| ^^^^^^^^^^^^^ no LOCAL_PEEREID in the root
Root cause:
In src/unix/nto/mod.rs, the cfg_if! block at line 906 splits QNX definitions into two branches:
- nto70 / nto71 (line 907): defines TCP_KEEPALIVE and LOCAL_PEEREID
- else — covering nto71_iosock and nto80 (line 982): does not define them
QNX 8.0 supports both constants. They should be added to the else branch.
Environment:
- libc: 0.2.185
- rustc: nightly (cross-compiling to aarch64-unknown-nto-qnx800)
- Host: x86_64-unknown-linux-gnu
- QNX SDP: 8.0
TCP_KEEPALIVE and LOCAL_PEEREID are defined in the nto70/nto71 branch of src/unix/nto/mod.rs (lines 919 and 967), but missing from the else branch that covers nto80 (QNX 8.0). This causes compilation failures for crates like
socket2 and tokio when targeting aarch64-unknown-nto-qnx800.
Target triple: aarch64-unknown-nto-qnx800
Minimum reproduction:
// main.rs — no dependencies other than libc
extern crate libc;
fn main() {
let _ = libc::TCP_KEEPALIVE; // error[E0432]: no
TCP_KEEPALIVEin the rootlet _ = libc::LOCAL_PEEREID; // error[E0432]: no
LOCAL_PEEREIDin the root}
Cargo.toml
[package]
name = "libc-qnx800-repro"
version = "0.1.0"
edition = "2021"
[dependencies]
libc = "0.2.185"
cargo build --target aarch64-unknown-nto-qnx800
Build log (trimmed):
error[E0432]: unresolved import
libc::TCP_KEEPALIVE--> /root/.cargo/registry/src/index.crates.io-.../socket2-0.5.10/src/sys/unix.rs:291:5
|
291 | use libc::TCP_KEEPALIVE as KEEPALIVE_TIME;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no
TCP_KEEPALIVEin the rooterror[E0432]: unresolved import
libc::LOCAL_PEEREID--> /root/.cargo/registry/src/index.crates.io-.../tokio-1.42.1/src/net/unix/ucred.rs:127:56
|
127 | use libc::{c_void, getsockopt, socklen_t, unpcbid, LOCAL_PEEREID, SOL_SOCKET};
| ^^^^^^^^^^^^^ no
LOCAL_PEEREIDin the rootRoot cause:
In src/unix/nto/mod.rs, the cfg_if! block at line 906 splits QNX definitions into two branches:
QNX 8.0 supports both constants. They should be added to the else branch.
Environment: