unix: guard use of PTHREAD_STACK_MIN
PTHREAD_STACK_MIN is an optional part of the POSIX spec and NetBSD deliberately does not implement it as it's a variable value in runtime. PR-URL: https://github.com/libuv/libuv/pull/2252 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
89a027d862
commit
38bb0f5f5f
@ -219,8 +219,10 @@ int uv_thread_create_ex(uv_thread_t* tid,
|
||||
pagesize = (size_t)getpagesize();
|
||||
/* Round up to the nearest page boundary. */
|
||||
stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1);
|
||||
#ifdef PTHREAD_STACK_MIN
|
||||
if (stack_size < PTHREAD_STACK_MIN)
|
||||
stack_size = PTHREAD_STACK_MIN;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (stack_size > 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user