1PTHREAD_ATTR_GETSCHEDPARAM(3PPO)SIX Programmer's ManPuTaHlREAD_ATTR_GETSCHEDPARAM(3P)
2
3
4

PROLOG

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

NAME

13       pthread_attr_getschedparam, pthread_attr_setschedparam —  get  and  set
14       the schedparam attribute
15

SYNOPSIS

17       #include <pthread.h>
18
19       int pthread_attr_getschedparam(const pthread_attr_t *restrict attr,
20           struct sched_param *restrict param);
21       int pthread_attr_setschedparam(pthread_attr_t *restrict attr,
22           const struct sched_param *restrict param);
23

DESCRIPTION

25       The pthread_attr_getschedparam() and pthread_attr_setschedparam() func‐
26       tions,  respectively,  shall  get  and  set  the  scheduling  parameter
27       attributes  in  the  attr argument. The contents of the param structure
28       are defined in the <sched.h> header. For the  SCHED_FIFO  and  SCHED_RR
29       policies, the only required member of param is sched_priority.
30
31       For the SCHED_SPORADIC policy, the required members of the param struc‐
32       ture are sched_priority,  sched_ss_low_priority,  sched_ss_repl_period,
33       sched_ss_init_budget,    and    sched_ss_max_repl.     The    specified
34       sched_ss_repl_period must be greater than or  equal  to  the  specified
35       sched_ss_init_budget  for  the  function to succeed; if it is not, then
36       the function shall fail. The value of sched_ss_max_repl shall be within
37       the  inclusive  range [1,{SS_REPL_MAX}] for the function to succeed; if
38       not,  the  function  shall  fail.   It  is  unspecified   whether   the
39       sched_ss_repl_period and sched_ss_init_budget values are stored as pro‐
40       vided by this function or are rounded to align with the  resolution  of
41       the clock being used.
42
43       The  behavior  is undefined if the value specified by the attr argument
44       to pthread_attr_getschedparam()  or  pthread_attr_setschedparam()  does
45       not refer to an initialized thread attributes object.
46

RETURN VALUE

48       If      successful,      the      pthread_attr_getschedparam()      and
49       pthread_attr_setschedparam() functions shall return zero; otherwise, an
50       error number shall be returned to indicate the error.
51

ERRORS

53       The pthread_attr_setschedparam() function shall fail if:
54
55       ENOTSUP
56              An  attempt  was  made  to  set  the attribute to an unsupported
57              value.
58
59       The pthread_attr_setschedparam() function may fail if:
60
61       EINVAL The value of param is not valid.
62
63       These functions shall not return an error code of [EINTR].
64
65       The following sections are informative.
66

EXAMPLES

68       None.
69

APPLICATION USAGE

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

RATIONALE

76       If an implementation detects that the value specified by the attr argu‐
77       ment  to  pthread_attr_getschedparam()  or pthread_attr_setschedparam()
78       does not refer to an initialized thread attributes object, it is recom‐
79       mended that the function should fail and report an [EINVAL] error.
80

FUTURE DIRECTIONS

82       None.
83

SEE ALSO

85       pthread_attr_destroy(), pthread_attr_getscope(), pthread_attr_getinher‐
86       itsched(), pthread_attr_getschedpolicy(), pthread_create()
87
88       The Base Definitions volume of POSIX.1‐2008, <pthread.h>, <sched.h>
89
91       Portions of this text are reprinted and reproduced in  electronic  form
92       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
93       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
94       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
95       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
96       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
97       event of any discrepancy between this version and the original IEEE and
98       The  Open Group Standard, the original IEEE and The Open Group Standard
99       is the referee document. The original Standard can be  obtained  online
100       at http://www.unix.org/online.html .
101
102       Any  typographical  or  formatting  errors that appear in this page are
103       most likely to have been introduced during the conversion of the source
104       files  to  man page format. To report such errors, see https://www.ker
105       nel.org/doc/man-pages/reporting_bugs.html .
106
107
108
109IEEE/The Open Group                  2013       PTHREAD_ATTR_GETSCHEDPARAM(3P)
Impressum