# pthread_attr_getschedparam

## 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_attr_getschedparam, pthread_attr_setschedparam — get and
           set the schedparam attribute
    


## SYNOPSIS



           #include <pthread.h>
    
           int pthread_attr_getschedparam(const pthread_attr_t *restrict _attr_ ,
               struct sched_param *restrict _param_);
           int pthread_attr_setschedparam(pthread_attr_t *restrict _attr_ ,
               const struct sched_param *restrict _param_);
    


## DESCRIPTION



           The _pthread_attr_getschedparam_() and _pthread_attr_setschedparam_()
           functions, respectively, shall get and set the scheduling
           parameter attributes in the _attr_ argument. The contents of the
           _param_ structure are defined in the _< sched.h>_ header. For the
           SCHED_FIFO and SCHED_RR policies, the only required member of
           _param_ is _sched_priority_.
    
           For the SCHED_SPORADIC policy, the required members of the _param_
           structure are _sched_priority_ , _sched_ss_low_priority_ ,
           _sched_ss_repl_period_ , _sched_ss_init_budget_ , and _sched_ss_max_repl_.
           The specified _sched_ss_repl_period_ must be greater than or equal
           to the specified _sched_ss_init_budget_ for the function to succeed;
           if it is not, then the function shall fail. The value of
           _sched_ss_max_repl_ shall be within the inclusive range
           [1,{SS_REPL_MAX}] for the function to succeed; if not, the
           function shall fail.  It is unspecified whether the
           _sched_ss_repl_period_ and _sched_ss_init_budget_ values are stored as
           provided by this function or are rounded to align with the
           resolution of the clock being used.
    
           The behavior is undefined if the value specified by the _attr_
           argument to _pthread_attr_getschedparam_() or
           _pthread_attr_setschedparam_() does not refer to an initialized
           thread attributes object.
    


## RETURN VALUE



           If successful, the _pthread_attr_getschedparam_() and
           _pthread_attr_setschedparam_() functions shall return zero;
           otherwise, an error number shall be returned to indicate the
           error.
    


## ERRORS



           The _pthread_attr_setschedparam_() function shall fail if:
    
           **ENOTSUP**
                  An attempt was made to set the attribute to an unsupported
                  value.
    
           The _pthread_attr_setschedparam_() function may fail if:
    
           **EINVAL** The value of _param_ is not valid.
    
           These functions shall not return an error code of **[EINTR]**.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           After these attributes have been set, a thread can be created with
           the specified attributes using _pthread_create_().  Using these
           routines does not affect the current running thread.
    


## RATIONALE



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


## FUTURE DIRECTIONS



           None.
    


* * *