]> git.saurik.com Git - apple/libpthread.git/blame - man/pthread_attr_set_getscope.3
libpthread-105.10.1.tar.gz
[apple/libpthread.git] / man / pthread_attr_set_getscope.3
CommitLineData
f1a1da6c
A
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
22Thread attributes are used to specify parameters to
23.Fn pthread_create .
24One attribute object can be used in multiple calls to
25.Fn pthread_create ,
26with or without modifications between calls.
27.Pp
28The
29.Fn pthread_attr_setscope
30and
31.Fn pthread_attr_getscope
32functions, respectively, set and get the attribute within
33.Fa attr
34argument that controls the contention scope of the thread.
35The acceptable values are PTHREAD_SCOPE_SYSTEM, indicating a scheduling contention scope that
36is system-wide, and PTHREAD_SCOPE_PROCESS, which indicates a process scheduling contention scope.
37Currently on Mac OS X we only support PTHREAD_SCOPE_SYSTEM.
38.Sh RETURN VALUES
39If successful, these functions return 0.
40Otherwise, an error number is returned to indicate the error.
41.Sh ERRORS
42.Pp
43.Fn pthread_attr_getscope
44will fail if:
45.Bl -tag -width Er
46.\" ========
47.It Bq Er EINVAL
48Invalid value for
49.Fa attr .
50.\" ========
51.El
52.Pp
53.Fn pthread_attr_setscope
54will fail if:
55.Bl -tag -width Er
56.\" ========
57.It Bq Er EINVAL
58Invalid value for
59.Fa attr .
60.\" ========
61.It Bq Er ENOTSUP
62Invalid 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
74conform to
75.St -susv2