Use PTHREAD_STACK_MIN conditionally in a test

PTHREAD_STACK_MIN is not available on NetBSD as it's not
clear what the value shall be represented by this constant
on a multiplatform OS.

llvm-svn: 344034
This commit is contained in:
Kamil Rytarowski 2018-10-09 10:32:01 +00:00
parent e324027b72
commit f58fe87743
1 changed files with 2 additions and 0 deletions

View File

@ -78,9 +78,11 @@ int main(int argc, char **argv) {
pthread_attr_init(&attr);
if (kStackSize > 0) {
size_t desired_stack_size = kStackSize;
#ifdef PTHREAD_STACK_MIN
if (desired_stack_size < PTHREAD_STACK_MIN) {
desired_stack_size = PTHREAD_STACK_MIN;
}
#endif
int ret = pthread_attr_setstacksize(&attr, desired_stack_size);
if (ret != 0) {