Skip to content

Commit 38bb0f5

Browse files
krytarowskicjihrig
authored andcommitted
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: #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>
1 parent 89a027d commit 38bb0f5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/unix/thread.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,10 @@ int uv_thread_create_ex(uv_thread_t* tid,
219219
pagesize = (size_t)getpagesize();
220220
/* Round up to the nearest page boundary. */
221221
stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1);
222+
#ifdef PTHREAD_STACK_MIN
222223
if (stack_size < PTHREAD_STACK_MIN)
223224
stack_size = PTHREAD_STACK_MIN;
225+
#endif
224226
}
225227

226228
if (stack_size > 0) {

0 commit comments

Comments
 (0)