Rollup merge of #133631 - flba-eb:add_nto_qnx71_iosock_support, r=workingjubilee
Support QNX 7.1 with `io-sock`+libstd and QNX 8.0 (`no_std` only) Changes of this pull request: 1. Refactor code for qnx nto targets to share more code in file `nto_qnx.rs` 1. Add support for an additional network stack on nto qnx 7.1. QNX 7.1 supports two network stacks: 1. `io-pkt`, which is default 2. `io-sock`, which is optional on 7.1 but default in QNX 8.0 As one can see in the [io-sock migration notes](https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.io_sock/topic/migrate_app.html), this changes the libc API in a way similar to e.g. linux-gnu vs. linux-musl. This change adds a new target which has a different value for `target_env`, so that e.g. libc can distinguish between both APIs. 2. Add initial support for QNX 8.0, thanks to AkhilTThomas. As it turned out, the problem with forking many processes still exists in QNX 8.0. Because if this, we are now using it for any QNX version (i.e. not check for `target_env` anymore).
This commit is contained in:
commit
0d0e841594
17 changed files with 285 additions and 141 deletions
|
@ -19,8 +19,7 @@ use crate::sys::process::process_common::*;
|
|||
use crate::{fmt, mem, sys};
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
// This workaround is only needed for QNX 7.0 and 7.1. The bug should have been fixed in 8.0
|
||||
if #[cfg(any(target_env = "nto70", target_env = "nto71"))] {
|
||||
if #[cfg(target_os = "nto")] {
|
||||
use crate::thread;
|
||||
use libc::{c_char, posix_spawn_file_actions_t, posix_spawnattr_t};
|
||||
use crate::time::Duration;
|
||||
|
@ -187,12 +186,7 @@ impl Command {
|
|||
|
||||
// Attempts to fork the process. If successful, returns Ok((0, -1))
|
||||
// in the child, and Ok((child_pid, -1)) in the parent.
|
||||
#[cfg(not(any(
|
||||
target_os = "watchos",
|
||||
target_os = "tvos",
|
||||
target_env = "nto70",
|
||||
target_env = "nto71"
|
||||
)))]
|
||||
#[cfg(not(any(target_os = "watchos", target_os = "tvos", target_os = "nto")))]
|
||||
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
|
||||
cvt(libc::fork())
|
||||
}
|
||||
|
@ -201,8 +195,7 @@ impl Command {
|
|||
// or closed a file descriptor while the fork() was occurring".
|
||||
// Documentation says "... or try calling fork() again". This is what we do here.
|
||||
// See also https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/f/fork.html
|
||||
// This workaround is only needed for QNX 7.0 and 7.1. The bug should have been fixed in 8.0
|
||||
#[cfg(any(target_env = "nto70", target_env = "nto71"))]
|
||||
#[cfg(target_os = "nto")]
|
||||
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
|
||||
use crate::sys::os::errno;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue