about summary refs log tree commit diff
diff options
context:
space:
mode:
authorB I Mohammed Abbas <bimohammdabbas@gmail.com>2024-07-23 16:58:00 +0530
committerB I Mohammed Abbas <bimohammdabbas@gmail.com>2024-07-23 16:58:00 +0530
commit786ad3d3ae8cd4dabf311d2cfcd5b03b420a249f (patch)
tree372abaa0703c734e92d1e34f6612e359d66f61e4
parent5c9f3762d0e90ac97485f3b3eb99bcee647322c5 (diff)
downloadrust-786ad3d3ae8cd4dabf311d2cfcd5b03b420a249f.tar.gz
rust-786ad3d3ae8cd4dabf311d2cfcd5b03b420a249f.zip
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)
-rw-r--r--library/std/src/sys/pal/unix/process/process_vxworks.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/unix/process/process_vxworks.rs b/library/std/src/sys/pal/unix/process/process_vxworks.rs
index 5007dbd34b4..26b8a0a39dc 100644
--- a/library/std/src/sys/pal/unix/process/process_vxworks.rs
+++ b/library/std/src/sys/pal/unix/process/process_vxworks.rs
@@ -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};
 
@@ -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();