Skip to content

Commit 63d2997

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 bee0155 commit 63d2997

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

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

@@ -68,7 +68,12 @@ 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(
72+
crate::env::var_os("RUST_MIN_STACK")
73+
.and_then(|s| s.to_str().and_then(|s| s.parse().ok()))
74+
.unwrap_or(thread::DEFAULT_MIN_STACK_SIZE),
75+
libc::PTHREAD_STACK_MIN,
76+
);
7277

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

0 commit comments

Comments
 (0)