summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_condattr_init.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-11-13 18:13:26 +0000
committerdeischen <deischen@FreeBSD.org>2002-11-13 18:13:26 +0000
commit524a6c841c467da890061cbdc2ace08d30e6e780 (patch)
tree666eecc4a4a3cc9346ca8828770bb7ef3723e4b2 /lib/libc_r/uthread/uthread_condattr_init.c
parentbf8788517dc3dbb62a46b61b9a2e31a4ba2d3dd4 (diff)
downloadFreeBSD-src-524a6c841c467da890061cbdc2ace08d30e6e780.zip
FreeBSD-src-524a6c841c467da890061cbdc2ace08d30e6e780.tar.gz
At initialization, override the pthread stub routines in libc
by filling in the jump table. Convert uses of pthread routines within libc_r to use the internal versions (_pthread_foo instead of pthread_foo). Remove a couple of globals from application namespace.
Diffstat (limited to 'lib/libc_r/uthread/uthread_condattr_init.c')
-rw-r--r--lib/libc_r/uthread/uthread_condattr_init.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc_r/uthread/uthread_condattr_init.c b/lib/libc_r/uthread/uthread_condattr_init.c
index cfc1e4a..92ce709 100644
--- a/lib/libc_r/uthread/uthread_condattr_init.c
+++ b/lib/libc_r/uthread/uthread_condattr_init.c
@@ -39,6 +39,8 @@
__weak_reference(_pthread_condattr_init, pthread_condattr_init);
+static struct pthread_cond_attr default_condattr = PTHREAD_CONDATTR_DEFAULT;
+
int
_pthread_condattr_init(pthread_condattr_t *attr)
{
@@ -46,11 +48,11 @@ _pthread_condattr_init(pthread_condattr_t *attr)
pthread_condattr_t pattr;
if ((pattr = (pthread_condattr_t)
- malloc(sizeof(struct pthread_cond_attr))) == NULL) {
+ malloc(sizeof(struct pthread_cond_attr))) == NULL) {
ret = ENOMEM;
} else {
- memcpy(pattr, &pthread_condattr_default,
- sizeof(struct pthread_cond_attr));
+ memcpy(pattr, &default_condattr,
+ sizeof(struct pthread_cond_attr));
*attr = pattr;
ret = 0;
}
OpenPOWER on IntegriCloud