Retry on EINVAL from pthread_attr_setstacksize()
Enforce that the stack size is > RED_ZONE + PTHREAD_STACK_MIN. If the call to pthread_attr_setstacksize() subsequently fails with EINVAL, it means that the platform requires the stack size to be a multiple of the page size. In that case, round up to the nearest page and retry. Fixes #11694.
This commit is contained in:
parent
464b2e2364
commit
b02b5cdcf4
2 changed files with 45 additions and 6 deletions
|
|
@ -24,7 +24,7 @@
|
|||
//! detection is not guaranteed to continue in the future. Usage of this module
|
||||
//! is discouraged unless absolutely necessary.
|
||||
|
||||
static RED_ZONE: uint = 20 * 1024;
|
||||
pub static RED_ZONE: uint = 20 * 1024;
|
||||
|
||||
/// This function is invoked from rust's current __morestack function. Segmented
|
||||
/// stacks are currently not enabled as segmented stacks, but rather one giant
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue