]> git.saurik.com Git - apple/libc.git/blob - pthreads/pthread_attr_set_getscope.3
Libc-825.40.1.tar.gz
[apple/libc.git] / pthreads / pthread_attr_set_getscope.3
1 .\" Copyright (c) 2004-2007 Apple Inc. All rights reserved.
2 .Dd December 31, 2007
3 .Dt PTHREAD_ATTR 3
4 .Os
5 .Sh NAME
6 .Nm pthread_attr_getscope ,
7 .Nm pthread_attr_setscope
8 .Nd thread attribute operations
9 .Sh SYNOPSIS
10 .Fd #include <pthread.h>
11 .Ft int
12 .Fo pthread_attr_getscope
13 .Fa "const pthread_attr_t *restrict attr"
14 .Fa "int *restrict contentionscope"
15 .Fc
16 .Ft int
17 .Fo pthread_attr_setscope
18 .Fa "pthread_attr_t *attr"
19 .Fa "int contentionscope"
20 .Fc
21 .Sh DESCRIPTION
22 Thread attributes are used to specify parameters to
23 .Fn pthread_create .
24 One attribute object can be used in multiple calls to
25 .Fn pthread_create ,
26 with or without modifications between calls.
27 .Pp
28 The
29 .Fn pthread_attr_setscope
30 and
31 .Fn pthread_attr_getscope
32 functions, respectively, set and get the attribute within
33 .Fa attr
34 argument that controls the contention scope of the thread.
35 The acceptable values are PTHREAD_SCOPE_SYSTEM, indicating a scheduling contention scope that
36 is system-wide, and PTHREAD_SCOPE_PROCESS, which indicates a process scheduling contention scope.
37 Currently on Mac OS X we only support PTHREAD_SCOPE_SYSTEM.
38 .Sh RETURN VALUES
39 If successful, these functions return 0.
40 Otherwise, an error number is returned to indicate the error.
41 .Sh ERRORS
42 .Pp
43 .Fn pthread_attr_getscope
44 will fail if:
45 .Bl -tag -width Er
46 .\" ========
47 .It Bq Er EINVAL
48 Invalid value for
49 .Fa attr .
50 .\" ========
51 .El
52 .Pp
53 .Fn pthread_attr_setscope
54 will fail if:
55 .Bl -tag -width Er
56 .\" ========
57 .It Bq Er EINVAL
58 Invalid value for
59 .Fa attr .
60 .\" ========
61 .It Bq Er ENOTSUP
62 Invalid or unsupported value for
63 .Fa contentionscope .
64 .El
65 .Sh SEE ALSO
66 .Xr pthread_create 3 ,
67 .Xr pthread_attr_init 3 ,
68 .Xr pthread_attr_setinheritsched 3 ,
69 .Xr pthread_attr_setschedpolicy 3 ,
70 .Xr pthread_attr_setschedparam 3
71 .Sh STANDARDS
72 .Fn pthread_attr_setscope ,
73 .Fn pthread_attr_getscope
74 conform to
75 .St -susv2