Skip to content

Commit

Permalink
Update process vxworks, set default stack size of 256 Kib for vxworks…
Browse files Browse the repository at this point in the history
…. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib)
  • Loading branch information
B I Mohammed Abbas committed Jul 23, 2024
1 parent 5c9f376 commit 786ad3d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions library/std/src/sys/pal/unix/process/process_vxworks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use crate::io::{self, ErrorKind};
use crate::num::NonZero;
use crate::sys;
use crate::sys::cvt;
use crate::sys::pal::unix::thread;
use crate::sys::process::process_common::*;
use crate::sys_common::thread;
use libc::RTP_ID;
use libc::{self, c_char, c_int};

Expand Down Expand Up @@ -68,7 +68,12 @@ impl Command {
.as_ref()
.map(|c| c.as_ptr())
.unwrap_or_else(|| *sys::os::environ() as *const _);
let stack_size = thread::min_stack();
let stack_size = crate::cmp::max(
crate::env::var_os("RUST_MIN_STACK")
.and_then(|s| s.to_str().and_then(|s| s.parse().ok()))
.unwrap_or(thread::DEFAULT_MIN_STACK_SIZE),
libc::PTHREAD_STACK_MIN,
);

// ensure that access to the environment is synchronized
let _lock = sys::os::env_read_lock();
Expand Down

0 comments on commit 786ad3d

Please sign in to comment.