Merge "bionic: Set PTHREAD_STACK_MIN for page agnostic targets" into main
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 1f08628..4feade5 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -34,6 +34,7 @@
*/
#include <limits.h>
+#include <bits/page_size.h>
#include <bits/pthread_types.h>
#include <sched.h>
#include <sys/cdefs.h>
@@ -73,9 +74,14 @@
#define PTHREAD_BARRIER_SERIAL_THREAD (-1)
#endif
+
#if defined(__LP64__)
+#if defined(PAGE_SIZE)
#define PTHREAD_STACK_MIN (4 * PAGE_SIZE)
#else
+#define PTHREAD_STACK_MIN 65536
+#endif
+#else
#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
#endif