# pthread_mutexattr_getprioceiling

## PROLOG



           This manual page is part of the POSIX Programmer's Manual.  The
           Linux implementation of this interface may differ (consult the
           corresponding Linux manual page for details of Linux behavior), or
           the interface may not be implemented on Linux.
    


## NAME



           pthread_mutexattr_getprioceiling, pthread_mutexattr_setprioceiling
           — get and set the prioceiling attribute of the mutex attributes
           object (**REALTIME THREADS**)
    


## SYNOPSIS



           #include <pthread.h>
    
           int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t
               *restrict _attr_ , int *restrict _prioceiling_);
           int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *_attr_ ,
               int _prioceiling_);
    


## DESCRIPTION



           The _pthread_mutexattr_getprioceiling_() and
           _pthread_mutexattr_setprioceiling_() functions, respectively, shall
           get and set the priority ceiling attribute of a mutex attributes
           object pointed to by _attr_ which was previously created by the
           function _pthread_mutexattr_init_().
    
           The _prioceiling_ attribute contains the priority ceiling of
           initialized mutexes. The values of _prioceiling_ are within the
           maximum range of priorities defined by SCHED_FIFO.
    
           The _prioceiling_ attribute defines the priority ceiling of
           initialized mutexes, which is the minimum priority level at which
           the critical section guarded by the mutex is executed. In order to
           avoid priority inversion, the priority ceiling of the mutex shall
           be set to a priority higher than or equal to the highest priority
           of all the threads that may lock that mutex. The values of
           _prioceiling_ are within the maximum range of priorities defined
           under the SCHED_FIFO scheduling policy.
    
           The behavior is undefined if the value specified by the _attr_
           argument to _pthread_mutexattr_getprioceiling_() or
           _pthread_mutexattr_setprioceiling_() does not refer to an
           initialized mutex attributes object.
    


## RETURN VALUE



           Upon successful completion, the _pthread_mutexattr_getprioceiling_()
           and _pthread_mutexattr_setprioceiling_() functions shall return
           zero; otherwise, an error number shall be returned to indicate the
           error.
    


## ERRORS



           These functions may fail if:
    
           **EINVAL** The value specified by _prioceiling_ is invalid.
    
           **EPERM** The caller does not have the privilege to perform the
                  operation.
    
           These functions shall not return an error code of **[EINTR]**.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           None.
    


## RATIONALE



           If an implementation detects that the value specified by the _attr_
           argument to _pthread_mutexattr_getprioceiling_() or
           _pthread_mutexattr_setprioceiling_() does not refer to an
           initialized mutex attributes object, it is recommended that the
           function should fail and report an **[EINVAL]** error.
    


## FUTURE DIRECTIONS



           None.
    


* * *