diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-08-09 08:50:55 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-08-09 08:50:55 +0000 |
commit | 67dd7f9e06096795f38e4bcf80d48888dded73e3 (patch) | |
tree | bd1fc1c355b4a43b0c3c798e0f6b303bacac07e3 /lib/libpthread/uthread/uthread_mattr_kind_np.c | |
parent | adf46ad22328061291b5cd5e00bbea631c643bca (diff) |
Implement pthread_mutexattr_gettype() as defined in Single Unix Spec, v2;
from FreeBSD.
Diffstat (limited to 'lib/libpthread/uthread/uthread_mattr_kind_np.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_mattr_kind_np.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_mattr_kind_np.c b/lib/libpthread/uthread/uthread_mattr_kind_np.c index 073c30da4e9..732c8682bbf 100644 --- a/lib/libpthread/uthread/uthread_mattr_kind_np.c +++ b/lib/libpthread/uthread/uthread_mattr_kind_np.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_mattr_kind_np.c,v 1.5 1999/11/25 07:01:38 d Exp $ */ +/* $OpenBSD: uthread_mattr_kind_np.c,v 1.6 2001/08/09 08:50:54 fgsch Exp $ */ /* * Copyright (c) 1996 Jeffrey Hsu <hsu@freebsd.org>. * All rights reserved. @@ -77,4 +77,19 @@ pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) } return(ret); } + +int +pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type) +{ + int ret; + + if (attr == NULL || *attr == NULL || (*attr)->m_type >= + MUTEX_TYPE_MAX) { + ret = EINVAL; + } else { + *type = (*attr)->m_type; + ret = 0; + } + return ret; +} #endif |