From 38bb0f5f5f4bc845daa823d1c696dfb0cbde2b47 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Thu, 11 Apr 2019 00:19:22 +0200 Subject: [PATCH] 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 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Santiago Gimeno --- src/unix/thread.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/thread.c b/src/unix/thread.c index 6088c77f..9a50448e 100644 --- a/src/unix/thread.c +++ b/src/unix/thread.c @@ -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) {