1PTHREAD_ATTR_GETINHERITSCHEDP(O3SPI)X Programmer's MPaTnHuRaElAD_ATTR_GETINHERITSCHED(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_getinheritsched, pthread_attr_setinheritsched  —  get  and
14       set the inheritsched attribute (REALTIME THREADS)
15

SYNOPSIS

17       #include <pthread.h>
18
19       int pthread_attr_getinheritsched(const pthread_attr_t *restrict attr,
20           int *restrict inheritsched);
21       int pthread_attr_setinheritsched(pthread_attr_t *attr,
22           int inheritsched);
23

DESCRIPTION

25       The  pthread_attr_getinheritsched()  and pthread_attr_setinheritsched()
26       functions, respectively, shall get and set the  inheritsched  attribute
27       in the attr argument.
28
29       When  the  attributes  objects are used by pthread_create(), the inher‐
30       itsched attribute determines how the other scheduling attributes of the
31       created thread shall be set.
32
33       The supported values of inheritsched shall be:
34
35       PTHREAD_INHERIT_SCHED
36             Specifies  that  the thread scheduling attributes shall be inher‐
37             ited from the creating thread, and the scheduling  attributes  in
38             this attr argument shall be ignored.
39
40       PTHREAD_EXPLICIT_SCHED
41             Specifies  that  the thread scheduling attributes shall be set to
42             the corresponding values from this attributes object.
43
44       The  symbols  PTHREAD_INHERIT_SCHED  and   PTHREAD_EXPLICIT_SCHED   are
45       defined in the <pthread.h> header.
46
47       The  following thread scheduling attributes defined by POSIX.1‐2008 are
48       affected by the inheritsched attribute:  scheduling  policy  (schedpol‐
49       icy),  scheduling  parameters  (schedparam),  and scheduling contention
50       scope (contentionscope).
51
52       The behavior is undefined if the value specified by the  attr  argument
53       to   pthread_attr_getinheritsched()  or  pthread_attr_setinheritsched()
54       does not refer to an initialized thread attributes object.
55

RETURN VALUE

57       If successful, the pthread_attr_getinheritsched() and pthread_attr_set‐
58       inheritsched()  functions shall return zero; otherwise, an error number
59       shall be returned to indicate the error.
60

ERRORS

62       The pthread_attr_setinheritsched() function shall fail if:
63
64       ENOTSUP
65              An attempt was made to  set  the  attribute  to  an  unsupported
66              value.
67
68       The pthread_attr_setinheritsched() function may fail if:
69
70       EINVAL The value of inheritsched is not valid.
71
72       These functions shall not return an error code of [EINTR].
73
74       The following sections are informative.
75

EXAMPLES

77       None.
78

APPLICATION USAGE

80       After  these attributes have been set, a thread can be created with the
81       specified attributes using pthread_create().  Using these routines does
82       not affect the current running thread.
83
84       See  Section  2.9.4,  Thread  Scheduling  for further details on thread
85       scheduling attributes and their default settings.
86

RATIONALE

88       If an implementation detects that the value specified by the attr argu‐
89       ment   to   pthread_attr_getinheritsched()   or  pthread_attr_setinher‐
90       itsched() does not refer to an initialized thread attributes object, it
91       is  recommended  that  the  function should fail and report an [EINVAL]
92       error.
93

FUTURE DIRECTIONS

95       None.
96

SEE ALSO

98       pthread_attr_destroy(), pthread_attr_getscope(), pthread_attr_getsched‐
99       policy(), pthread_attr_getschedparam(), pthread_create()
100
101       The Base Definitions volume of POSIX.1‐2008, <pthread.h>, <sched.h>
102
104       Portions  of  this text are reprinted and reproduced in electronic form
105       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
106       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
107       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
108       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
109       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
110       event of any discrepancy between this version and the original IEEE and
111       The Open Group Standard, the original IEEE and The Open Group  Standard
112       is  the  referee document. The original Standard can be obtained online
113       at http://www.unix.org/online.html .
114
115       Any typographical or formatting errors that appear  in  this  page  are
116       most likely to have been introduced during the conversion of the source
117       files to man page format. To report such errors,  see  https://www.ker
118       nel.org/doc/man-pages/reporting_bugs.html .
119
120
121
122IEEE/The Open Group                  2013     PTHREAD_ATTR_GETINHERITSCHED(3P)
Impressum