summaryrefslogtreecommitdiff
path: root/src/thread/pthread_attr_setstacksize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/pthread_attr_setstacksize.c')
-rw-r--r--src/thread/pthread_attr_setstacksize.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/thread/pthread_attr_setstacksize.c b/src/thread/pthread_attr_setstacksize.c
new file mode 100644
index 00000000..58f4bb18
--- /dev/null
+++ b/src/thread/pthread_attr_setstacksize.c
@@ -0,0 +1,8 @@
+#include "pthread_impl.h"
+
+int pthread_attr_setstacksize(pthread_attr_t *a, size_t size)
+{
+ if (size-PAGE_SIZE > SIZE_MAX/4) return EINVAL;
+ a->__stacksize = size - DEFAULT_STACK_SIZE;
+ return 0;
+}