From 8cdf733f5003255ae7914f0a3b01f744f4add517 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 6 Jul 2009 14:46:36 +0000 Subject: 2009-07-06 Joel Sherrill * posix/Makefile.am, posix/src/mutex.c, posix/src/mutexinit.c: Add initial support for the pthread mutex type attribute added by UNIX98. It can be normal, recursive, errorcheck or default. * posix/src/mutexattrgettype.c, posix/src/mutexattrsettype.c: New files. --- cpukit/posix/src/mutexattrgettype.c | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 cpukit/posix/src/mutexattrgettype.c (limited to 'cpukit/posix/src/mutexattrgettype.c') diff --git a/cpukit/posix/src/mutexattrgettype.c b/cpukit/posix/src/mutexattrgettype.c new file mode 100644 index 0000000000..2d392967a3 --- /dev/null +++ b/cpukit/posix/src/mutexattrgettype.c @@ -0,0 +1,39 @@ +/* + * COPYRIGHT (c) 1989-2009. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include + +#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) +int pthread_mutexattr_gettype( + const pthread_mutexattr_t *attr, + int *type +) +{ + if ( !attr || !attr->is_initialized || !type ) + return EINVAL; + + *type = attr->type; + return 0; +} +#endif + -- cgit v1.2.3