summaryrefslogtreecommitdiff
path: root/src/thread/pthread_attr_getstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread/pthread_attr_getstack.c')
-rw-r--r--src/thread/pthread_attr_getstack.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/thread/pthread_attr_getstack.c b/src/thread/pthread_attr_getstack.c
new file mode 100644
index 00000000..07ac5926
--- /dev/null
+++ b/src/thread/pthread_attr_getstack.c
@@ -0,0 +1,10 @@
+#include "pthread_impl.h"
+
+int pthread_attr_getstack(const pthread_attr_t *a, void **addr, size_t *size)
+{
+ if (!a->_a_stackaddr)
+ return EINVAL;
+ *size = a->_a_stacksize + DEFAULT_STACK_SIZE;
+ *addr = (void *)(a->_a_stackaddr - *size);
+ return 0;
+}