Skip to content

Commit bbe475a

Browse files
author
B I Mohammed Abbas
committed
Update process vxworks, set default stack size of 256 Kib for vxworks. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib)
1 parent 5c9f376 commit bbe475a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/std/src/sys/pal/unix/process/process_vxworks.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::num::NonZero;
44
use crate::sys;
55
use crate::sys::cvt;
66
use crate::sys::process::process_common::*;
7-
use crate::sys_common::thread;
7+
use crate::sys::pal::unix::thread;
88
use libc::RTP_ID;
99
use libc::{self, c_char, c_int};
1010

@@ -68,7 +68,9 @@ impl Command {
6868
.as_ref()
6969
.map(|c| c.as_ptr())
7070
.unwrap_or_else(|| *sys::os::environ() as *const _);
71-
let stack_size = thread::min_stack();
71+
let stack_size = crate::cmp::max(crate::env::var_os("RUST_MIN_STACK")
72+
.and_then(|s| s.to_str().and_then(|s| s.parse().ok()))
73+
.unwrap_or(thread::DEFAULT_MIN_STACK_SIZE), thread::DEFAULT_MIN_STACK_SIZE);
7274

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

0 commit comments

Comments
 (0)