summaryrefslogtreecommitdiff
path: root/05/musl-0.6.0/src/thread/pthread_attr_setstacksize.c
diff options
context:
space:
mode:
Diffstat (limited to '05/musl-0.6.0/src/thread/pthread_attr_setstacksize.c')
-rw-r--r--05/musl-0.6.0/src/thread/pthread_attr_setstacksize.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/05/musl-0.6.0/src/thread/pthread_attr_setstacksize.c b/05/musl-0.6.0/src/thread/pthread_attr_setstacksize.c
new file mode 100644
index 0000000..df16b98
--- /dev/null
+++ b/05/musl-0.6.0/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->_a_stacksize = size - DEFAULT_STACK_SIZE;
+ return 0;
+}