1
Fork 0

add nto80 x86-64 and aarch64 target

Signed-off-by: Florian Bartels <Florian.Bartels@elektrobit.com>
This commit is contained in:
AkhilTThomas 2024-12-06 11:38:25 +01:00 committed by Florian Bartels
parent 62661f2592
commit 3f045c9d2e
9 changed files with 39 additions and 14 deletions

View file

@ -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", target_env = "nto71_iosock"))] {
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,13 +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",
target_env = "nto71_iosock",
)))]
#[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())
}
@ -202,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", target_env = "nto71_iosock"))]
#[cfg(target_os = "nto")]
unsafe fn do_fork(&mut self) -> Result<pid_t, io::Error> {
use crate::sys::os::errno;