Multithreaded Programming Guide

Get Mutex Attribute's Protocol

pthread_mutexattr_getprotocol(3THR)

pthread_mutexattr_getprotocol(3THR) gets the protocol attribute of a mutex attribute object.

#include <pthread.h>

int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, 
											int *protocol);

attr points to a mutex attribute object created by an earlier call to pthread_mutexattr_init().

protocol contains the protocol attribute: PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT.

Return Values

On successful completion, pthread_mutexattr_getprotocol() returns 0. Any other return value indicates that an error occurred.

If the following condition occurs, pthread_mutexattr_getprotocol() fails and returns the corresponding value.


ENOSYS

Neither of the options, _POSIX_THREAD_PRIO_INHERIT nor _POSIX_THREAD_PRIO_PROTECT is defined and the implementation does not support the function.

If either of the following conditions occurs, pthread_mutexattr_getprotocol() might fail and return the corresponding value.


EINVAL

The value specified by attr is invalid.


EPERM

The caller does not have the privilege to perform the operation.