Blame man-pages-posix-2013-a/man3p/pthread_attr_getschedparam.3p

Packit 7cfc04
'\" et
Packit 7cfc04
.TH PTHREAD_ATTR_GETSCHEDPARAM "3P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
Packit 7cfc04
.SH PROLOG
Packit 7cfc04
This manual page is part of the POSIX Programmer's Manual.
Packit 7cfc04
The Linux implementation of this interface may differ (consult
Packit 7cfc04
the corresponding Linux manual page for details of Linux behavior),
Packit 7cfc04
or the interface may not be implemented on Linux.
Packit 7cfc04
Packit 7cfc04
.SH NAME
Packit 7cfc04
pthread_attr_getschedparam,
Packit 7cfc04
pthread_attr_setschedparam
Packit 7cfc04
\(em get and set the schedparam attribute
Packit 7cfc04
.SH SYNOPSIS
Packit 7cfc04
.LP
Packit 7cfc04
.nf
Packit 7cfc04
#include <pthread.h>
Packit 7cfc04
.P
Packit 7cfc04
int pthread_attr_getschedparam(const pthread_attr_t *restrict \fIattr\fP,
Packit 7cfc04
    struct sched_param *restrict \fIparam\fP);
Packit 7cfc04
int pthread_attr_setschedparam(pthread_attr_t *restrict \fIattr\fP,
Packit 7cfc04
    const struct sched_param *restrict \fIparam\fP);
Packit 7cfc04
.fi
Packit 7cfc04
.SH DESCRIPTION
Packit 7cfc04
The
Packit 7cfc04
\fIpthread_attr_getschedparam\fR()
Packit 7cfc04
and
Packit 7cfc04
\fIpthread_attr_setschedparam\fR()
Packit 7cfc04
functions, respectively, shall get and set the scheduling parameter
Packit 7cfc04
attributes in the
Packit 7cfc04
.IR attr
Packit 7cfc04
argument. The contents of the
Packit 7cfc04
.IR param
Packit 7cfc04
structure are defined in the
Packit 7cfc04
.IR <sched.h> 
Packit 7cfc04
header. For the SCHED_FIFO and SCHED_RR policies,
Packit 7cfc04
the only required member of
Packit 7cfc04
.IR param
Packit 7cfc04
is
Packit 7cfc04
.IR sched_priority .
Packit 7cfc04
.P
Packit 7cfc04
For the SCHED_SPORADIC policy, the required members of the
Packit 7cfc04
.IR param
Packit 7cfc04
structure are
Packit 7cfc04
.IR sched_priority ,
Packit 7cfc04
.IR sched_ss_low_priority ,
Packit 7cfc04
.IR sched_ss_repl_period ,
Packit 7cfc04
.IR sched_ss_init_budget ,
Packit 7cfc04
and
Packit 7cfc04
.IR sched_ss_max_repl .
Packit 7cfc04
The specified
Packit 7cfc04
.IR sched_ss_repl_period
Packit 7cfc04
must be greater than or equal to the specified
Packit 7cfc04
.IR sched_ss_init_budget
Packit 7cfc04
for the function to succeed; if it is not, then the function shall
Packit 7cfc04
fail. The value of
Packit 7cfc04
.IR sched_ss_max_repl
Packit 7cfc04
shall be within the inclusive range [1,\c
Packit 7cfc04
{SS_REPL_MAX}]
Packit 7cfc04
for the function to succeed; if not, the function shall fail.
Packit 7cfc04
It is unspecified whether the
Packit 7cfc04
.IR sched_ss_repl_period
Packit 7cfc04
and
Packit 7cfc04
.IR sched_ss_init_budget
Packit 7cfc04
values are stored as provided by this function or are rounded to
Packit 7cfc04
align with the resolution of the clock being used.
Packit 7cfc04
.P
Packit 7cfc04
The behavior is undefined if the value specified by the
Packit 7cfc04
.IR attr
Packit 7cfc04
argument to
Packit 7cfc04
\fIpthread_attr_getschedparam\fR()
Packit 7cfc04
or
Packit 7cfc04
\fIpthread_attr_setschedparam\fR()
Packit 7cfc04
does not refer to an initialized thread attributes object.
Packit 7cfc04
.SH "RETURN VALUE"
Packit 7cfc04
If successful, the
Packit 7cfc04
\fIpthread_attr_getschedparam\fR()
Packit 7cfc04
and
Packit 7cfc04
\fIpthread_attr_setschedparam\fR()
Packit 7cfc04
functions shall return zero; otherwise, an error number shall be
Packit 7cfc04
returned to indicate the error.
Packit 7cfc04
.SH ERRORS
Packit 7cfc04
The
Packit 7cfc04
\fIpthread_attr_setschedparam\fR()
Packit 7cfc04
function shall fail if:
Packit 7cfc04
.TP
Packit 7cfc04
.BR ENOTSUP
Packit 7cfc04
An attempt was made to set the attribute to an unsupported value.
Packit 7cfc04
.P
Packit 7cfc04
The
Packit 7cfc04
\fIpthread_attr_setschedparam\fR()
Packit 7cfc04
function may fail if:
Packit 7cfc04
.TP
Packit 7cfc04
.BR EINVAL
Packit 7cfc04
The value of
Packit 7cfc04
.IR param
Packit 7cfc04
is not valid.
Packit 7cfc04
.P
Packit 7cfc04
These functions shall not return an error code of
Packit 7cfc04
.BR [EINTR] .
Packit 7cfc04
.LP
Packit 7cfc04
.IR "The following sections are informative."
Packit 7cfc04
.SH EXAMPLES
Packit 7cfc04
None.
Packit 7cfc04
.SH "APPLICATION USAGE"
Packit 7cfc04
After these attributes have been set, a thread can be created with the
Packit 7cfc04
specified attributes using
Packit 7cfc04
\fIpthread_create\fR().
Packit 7cfc04
Using these routines does not affect the current running thread.
Packit 7cfc04
.SH RATIONALE
Packit 7cfc04
If an implementation detects that the value specified by the
Packit 7cfc04
.IR attr
Packit 7cfc04
argument to
Packit 7cfc04
\fIpthread_attr_getschedparam\fR()
Packit 7cfc04
or
Packit 7cfc04
\fIpthread_attr_setschedparam\fR()
Packit 7cfc04
does not refer to an initialized thread attributes object, it is
Packit 7cfc04
recommended that the function should fail and report an
Packit 7cfc04
.BR [EINVAL] 
Packit 7cfc04
error.
Packit 7cfc04
.SH "FUTURE DIRECTIONS"
Packit 7cfc04
None.
Packit 7cfc04
.SH "SEE ALSO"
Packit 7cfc04
.ad l
Packit 7cfc04
.IR "\fIpthread_attr_destroy\fR\^(\|)",
Packit 7cfc04
.IR "\fIpthread_attr_getscope\fR\^(\|)",
Packit 7cfc04
.IR "\fIpthread_attr_getinheritsched\fR\^(\|)",
Packit 7cfc04
.IR "\fIpthread_attr_getschedpolicy\fR\^(\|)",
Packit 7cfc04
.IR "\fIpthread_create\fR\^(\|)"
Packit 7cfc04
.ad b
Packit 7cfc04
.P
Packit 7cfc04
The Base Definitions volume of POSIX.1\(hy2008,
Packit 7cfc04
.IR "\fB<pthread.h>\fP",
Packit 7cfc04
.IR "\fB<sched.h>\fP"
Packit 7cfc04
.SH COPYRIGHT
Packit 7cfc04
Portions of this text are reprinted and reproduced in electronic form
Packit 7cfc04
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
Packit 7cfc04
-- Portable Operating System Interface (POSIX), The Open Group Base
Packit 7cfc04
Specifications Issue 7, Copyright (C) 2013 by the Institute of
Packit 7cfc04
Electrical and Electronics Engineers, Inc and The Open Group.
Packit 7cfc04
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
Packit 7cfc04
event of any discrepancy between this version and the original IEEE and
Packit 7cfc04
The Open Group Standard, the original IEEE and The Open Group Standard
Packit 7cfc04
is the referee document. The original Standard can be obtained online at
Packit 7cfc04
http://www.unix.org/online.html .
Packit 7cfc04
Packit 7cfc04
Any typographical or formatting errors that appear
Packit 7cfc04
in this page are most likely
Packit 7cfc04
to have been introduced during the conversion of the source files to
Packit 7cfc04
man page format. To report such errors, see
Packit 7cfc04
https://www.kernel.org/doc/man-pages/reporting_bugs.html .