diff options
author | 2001-08-09 08:50:54 +0000 | |
---|---|---|
committer | 2001-08-09 08:50:54 +0000 | |
commit | 0e9f59c2f375dfff8af0a03db722e034db70c569 (patch) | |
tree | 345f7c9135557ae0f4312db1b4253254f20f16b1 /lib/libpthread/uthread | |
parent | sync, simplify, etc. slstats -i is now called -w, like pppstats (diff) | |
download | wireguard-openbsd-0e9f59c2f375dfff8af0a03db722e034db70c569.tar.xz wireguard-openbsd-0e9f59c2f375dfff8af0a03db722e034db70c569.zip |
Implement pthread_mutexattr_gettype() as defined in Single Unix Spec, v2;
from FreeBSD.
Diffstat (limited to 'lib/libpthread/uthread')
-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 |