1PTHREAD_ATTR_GETINHERITSCHEDP(O3SPI)X Programmer's MPaTnHuRaElAD_ATTR_GETINHERITSCHED(3P)
2
3
4
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
12 pthread_attr_getinheritsched, pthread_attr_setinheritsched — get and
13 set the inheritsched attribute (REALTIME THREADS)
14
16 #include <pthread.h>
17
18 int pthread_attr_getinheritsched(const pthread_attr_t *restrict attr,
19 int *restrict inheritsched);
20 int pthread_attr_setinheritsched(pthread_attr_t *attr,
21 int inheritsched);
22
24 The pthread_attr_getinheritsched() and pthread_attr_setinheritsched()
25 functions, respectively, shall get and set the inheritsched attribute
26 in the attr argument.
27
28 When the attributes objects are used by pthread_create(), the inher‐
29 itsched attribute determines how the other scheduling attributes of the
30 created thread shall be set.
31
32 The supported values of inheritsched shall be:
33
34 PTHREAD_INHERIT_SCHED
35 Specifies that the thread scheduling attributes shall be inher‐
36 ited from the creating thread, and the scheduling attributes in
37 this attr argument shall be ignored.
38
39 PTHREAD_EXPLICIT_SCHED
40 Specifies that the thread scheduling attributes shall be set to
41 the corresponding values from this attributes object.
42
43 The symbols PTHREAD_INHERIT_SCHED and PTHREAD_EXPLICIT_SCHED are
44 defined in the <pthread.h> header.
45
46 The following thread scheduling attributes defined by POSIX.1‐2008 are
47 affected by the inheritsched attribute: scheduling policy (schedpol‐
48 icy), scheduling parameters (schedparam), and scheduling contention
49 scope (contentionscope).
50
51 The behavior is undefined if the value specified by the attr argument
52 to pthread_attr_getinheritsched() or pthread_attr_setinheritsched()
53 does not refer to an initialized thread attributes object.
54
56 If successful, the pthread_attr_getinheritsched() and pthread_attr_set‐
57 inheritsched() functions shall return zero; otherwise, an error number
58 shall be returned to indicate the error.
59
61 The pthread_attr_setinheritsched() function shall fail if:
62
63 ENOTSUP
64 An attempt was made to set the attribute to an unsupported
65 value.
66
67 The pthread_attr_setinheritsched() function may fail if:
68
69 EINVAL The value of inheritsched is not valid.
70
71 These functions shall not return an error code of [EINTR].
72
73 The following sections are informative.
74
76 None.
77
79 After these attributes have been set, a thread can be created with the
80 specified attributes using pthread_create(). Using these routines does
81 not affect the current running thread.
82
83 See Section 2.9.4, Thread Scheduling for further details on thread
84 scheduling attributes and their default settings.
85
87 If an implementation detects that the value specified by the attr argu‐
88 ment to pthread_attr_getinheritsched() or pthread_attr_setinher‐
89 itsched() does not refer to an initialized thread attributes object, it
90 is recommended that the function should fail and report an [EINVAL]
91 error.
92
94 None.
95
97 pthread_attr_destroy(), pthread_attr_getscope(), pthread_attr_getsched‐
98 policy(), pthread_attr_getschedparam(), pthread_create()
99
100 The Base Definitions volume of POSIX.1‐2017, <pthread.h>, <sched.h>
101
103 Portions of this text are reprinted and reproduced in electronic form
104 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
105 table Operating System Interface (POSIX), The Open Group Base Specifi‐
106 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
107 Electrical and Electronics Engineers, Inc and The Open Group. In the
108 event of any discrepancy between this version and the original IEEE and
109 The Open Group Standard, the original IEEE and The Open Group Standard
110 is the referee document. The original Standard can be obtained online
111 at http://www.opengroup.org/unix/online.html .
112
113 Any typographical or formatting errors that appear in this page are
114 most likely to have been introduced during the conversion of the source
115 files to man page format. To report such errors, see https://www.ker‐
116 nel.org/doc/man-pages/reporting_bugs.html .
117
118
119
120IEEE/The Open Group 2017 PTHREAD_ATTR_GETINHERITSCHED(3P)