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
11

NAME

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

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

59       None.
60

APPLICATION USAGE

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

RATIONALE

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

FUTURE DIRECTIONS

76       None.
77

SEE ALSO

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