From 31fb174dd295e50f7c5cf18d31fcfd5fe5a063b7 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 8 Nov 2016 12:09:05 -0500 Subject: add limited pthread_setattr_default_np API to set stack size defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit based on patch by Timo Teräs: While generally this is a bad API, it is the only existing API to affect c++ (std::thread) and c11 (thrd_create) thread stack size. This patch allows applications only to increate stack and guard page sizes. --- include/pthread.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/pthread.h b/include/pthread.h index 94ef919c..bba9587e 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -215,6 +215,8 @@ int pthread_getaffinity_np(pthread_t, size_t, struct cpu_set_t *); int pthread_setaffinity_np(pthread_t, size_t, const struct cpu_set_t *); int pthread_getattr_np(pthread_t, pthread_attr_t *); int pthread_setname_np(pthread_t, const char *); +int pthread_getattr_default_np(pthread_attr_t *); +int pthread_setattr_default_np(const pthread_attr_t *); int pthread_tryjoin_np(pthread_t, void **); int pthread_timedjoin_np(pthread_t, void **, const struct timespec *); #endif -- cgit v1.2.1