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
23
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 PTHREAD_INHERIT_SCHED
34
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
41 Specifies that the thread scheduling attributes shall be set to
42 the corresponding values from this attributes object.
43
44
45 The symbols PTHREAD_INHERIT_SCHED and PTHREAD_EXPLICIT_SCHED are
46 defined in the <pthread.h> header.
47
48 The following thread scheduling attributes defined by
49 IEEE Std 1003.1-2001 are affected by the inheritsched attribute: sched‐
50 uling policy ( schedpolicy), scheduling parameters ( schedparam), and
51 scheduling contention scope ( contentionscope).
52
54 If successful, the pthread_attr_getinheritsched() and pthread_attr_set‐
55 inheritsched() functions shall return zero; otherwise, an error number
56 shall be returned to indicate the error.
57
59 The pthread_attr_setinheritsched() function may fail if:
60
61 EINVAL The value of inheritsched is not valid.
62
63 ENOTSUP
64 An attempt was made to set the attribute to an unsupported
65 value.
66
67
68 These functions shall not return an error code of [EINTR].
69
70 The following sections are informative.
71
73 None.
74
76 After these attributes have been set, a thread can be created with the
77 specified attributes using pthread_create(). Using these routines does
78 not affect the current running thread.
79
81 None.
82
84 None.
85
87 pthread_attr_destroy(), pthread_attr_getscope(), pthread_attr_getsched‐
88 policy(), pthread_attr_getschedparam(), pthread_create(), the Base Def‐
89 initions volume of IEEE Std 1003.1-2001, <pthread.h>, <sched.h>
90
92 Portions of this text are reprinted and reproduced in electronic form
93 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
94 -- Portable Operating System Interface (POSIX), The Open Group Base
95 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
96 Electrical and Electronics Engineers, Inc and The Open Group. 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.opengroup.org/unix/online.html .
101
102
103
104IEEE/The Open Group 2003 PTHREAD_ATTR_GETINHERITSCHED(3P)