1PTHREAD_ATTR_GETSCOPE(3P)  POSIX Programmer's Manual PTHREAD_ATTR_GETSCOPE(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

NAME

12       pthread_attr_getscope, pthread_attr_setscope — get  and  set  the  con‐
13       tentionscope attribute (REALTIME THREADS)
14

SYNOPSIS

16       #include <pthread.h>
17
18       int pthread_attr_getscope(const pthread_attr_t *restrict attr,
19           int *restrict contentionscope);
20       int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope);
21

DESCRIPTION

23       The   pthread_attr_getscope()  and  pthread_attr_setscope()  functions,
24       respectively, shall get and set the contentionscope  attribute  in  the
25       attr object.
26
27       The contentionscope attribute may have the values PTHREAD_SCOPE_SYSTEM,
28       signifying     system     scheduling     contention      scope,      or
29       PTHREAD_SCOPE_PROCESS,  signifying process scheduling contention scope.
30       The symbols PTHREAD_SCOPE_SYSTEM and PTHREAD_SCOPE_PROCESS are  defined
31       in the <pthread.h> header.
32
33       The  behavior  is undefined if the value specified by the attr argument
34       to pthread_attr_getscope() or pthread_attr_setscope() does not refer to
35       an initialized thread attributes object.
36

RETURN VALUE

38       If  successful, the pthread_attr_getscope() and pthread_attr_setscope()
39       functions shall return  zero;  otherwise,  an  error  number  shall  be
40       returned to indicate the error.
41

ERRORS

43       The pthread_attr_setscope() function shall fail if:
44
45       ENOTSUP
46              An  attempt  was  made  to  set  the attribute to an unsupported
47              value.
48
49       The pthread_attr_setscope() function may fail if:
50
51       EINVAL The value of contentionscope is not valid.
52
53       These functions shall not return an error code of [EINTR].
54
55       The following sections are informative.
56

EXAMPLES

58       None.
59

APPLICATION USAGE

61       After these attributes have been set, a thread can be created with  the
62       specified attributes using pthread_create().  Using these routines does
63       not affect the current running thread.
64
65       See Section 2.9.4, Thread Scheduling  for  further  details  on  thread
66       scheduling attributes and their default settings.
67

RATIONALE

69       If an implementation detects that the value specified by the attr argu‐
70       ment to pthread_attr_getscope()  or  pthread_attr_setscope()  does  not
71       refer  to  an  initialized  thread attributes object, it is recommended
72       that the function should fail and report an [EINVAL] error.
73

FUTURE DIRECTIONS

75       None.
76

SEE ALSO

78       pthread_attr_destroy(), pthread_attr_getinheritsched(),
79       pthread_attr_getschedpolicy(), pthread_attr_getschedparam(),
80       pthread_create()
81
82       The Base Definitions volume of POSIX.1‐2017, <pthread.h>, <sched.h>
83
85       Portions of this text are reprinted and reproduced in  electronic  form
86       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
87       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
88       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
89       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
90       event of any discrepancy between this version and the original IEEE and
91       The Open Group Standard, the original IEEE and The Open Group  Standard
92       is  the  referee document. The original Standard can be obtained online
93       at http://www.opengroup.org/unix/online.html .
94
95       Any typographical or formatting errors that appear  in  this  page  are
96       most likely to have been introduced during the conversion of the source
97       files to man page format. To report such errors,  see  https://www.ker
98       nel.org/doc/man-pages/reporting_bugs.html .
99
100
101
102IEEE/The Open Group                  2017            PTHREAD_ATTR_GETSCOPE(3P)
Impressum