summaryrefslogtreecommitdiff
path: root/lib/librthread/rthread_attr.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2005-12-19 06:45:15 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2005-12-19 06:45:15 +0000
commitf0c8c312f92a358dad31c3b753cfffed42223cb9 (patch)
tree51d8d4f04f0887399d6f0564cb54f23867cb8142 /lib/librthread/rthread_attr.c
parentdaa9b064a328487f6d7c1ea9da14fa9490977332 (diff)
add pthread_get/set_concurrency (useless for now)
add pthread_get/set_stack[addr] (info not used yet)
Diffstat (limited to 'lib/librthread/rthread_attr.c')
-rw-r--r--lib/librthread/rthread_attr.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/lib/librthread/rthread_attr.c b/lib/librthread/rthread_attr.c
index 532a53d0f17..c6795f7946c 100644
--- a/lib/librthread/rthread_attr.c
+++ b/lib/librthread/rthread_attr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rthread_attr.c,v 1.1 2005/12/03 18:16:19 tedu Exp $ */
+/* $OpenBSD: rthread_attr.c,v 1.2 2005/12/19 06:45:14 tedu Exp $ */
/*
* Copyright (c) 2004 Ted Unangst <tedu@openbsd.org>
* All Rights Reserved.
@@ -76,12 +76,30 @@ pthread_attr_setdetachstate(pthread_attr_t *attrp, int detachstate)
}
int
-pthread_attr_getstacksize(const pthread_attr_t *attrp, size_t *stacksize)
+pthread_attr_getstack(const pthread_attr_t *attrp, void **stackaddr,
+ size_t *stacksize)
{
+ *stackaddr = (*attrp)->stack_addr;
*stacksize = (*attrp)->stack_size;
return (0);
+}
+int
+pthread_attr_setstack(pthread_attr_t *attrp, void *stackaddr, size_t stacksize)
+{
+ (*attrp)->stack_addr = stackaddr;
+ (*attrp)->stack_size = stacksize;
+
+ return (0);
+}
+
+int
+pthread_attr_getstacksize(const pthread_attr_t *attrp, size_t *stacksize)
+{
+ *stacksize = (*attrp)->stack_size;
+
+ return (0);
}
int
@@ -93,6 +111,22 @@ pthread_attr_setstacksize(pthread_attr_t *attrp, size_t stacksize)
}
int
+pthread_attr_getstackaddr(const pthread_attr_t *attrp, void **stackaddr)
+{
+ *stackaddr = (*attrp)->stack_addr;
+
+ return (0);
+}
+
+int
+pthread_attr_setstackaddr(pthread_attr_t *attrp, void *stackaddr)
+{
+ (*attrp)->stack_addr = stackaddr;
+
+ return (0);
+}
+
+int
pthread_attr_getscope(const pthread_attr_t *attrp, int *contentionscope)
{
*contentionscope = (*attrp)->contention_scope;