]> git.saurik.com Git - apple/libpthread.git/blame_incremental - man/pthread_attr_set_getinheritsched.3
libpthread-454.100.8.tar.gz
[apple/libpthread.git] / man / pthread_attr_set_getinheritsched.3
... / ...
CommitLineData
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_getinheritsched ,
7.Nm pthread_attr_setinheritsched
8.Nd thread attribute operations
9.Sh SYNOPSIS
10.Fd #include <pthread.h>
11.Ft int
12.Fo pthread_attr_getinheritsched
13.Fa "const pthread_attr_t *restrict attr"
14.Fa "int *restrict inheritsched"
15.Fc
16.Ft int
17.Fo pthread_attr_setinheritsched
18.Fa "pthread_attr_t *attr"
19.Fa "int inheritsched"
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
28One of the thread attributes of interest is the "inheritsched" attribute. This attribute
29controls the scheduling policy and related attributes of the newly created thread. The values of the
30"inheritsched" attribute can be either PTHREAD_INHERIT_SCHED or PTHREAD_EXPLICIT_SCHED.
31.Pp
32PTHREAD_INHERIT_SCHED
33.Pp
34 Indicates that the newly created thread should inherit all it's scheduling related attributes from it's creating
35thread. It ignores the values of the relevant attributes within the
36.Fa attr
37argument.
38.Pp
39PTHREAD_EXPLICIT_SCHED
40.Pp
41 Indicates that the newly created thread should set it's scheduling related attributes based on
42.Fa attr
43argument.
44.Pp
45The
46.Fn pthread_attr_setinheritsched
47functions set the "inheritsched" attribute within the
48.Fa attr
49argument to the desired value.
50.Pp
51The
52.Fn pthread_attr_getinheritsched
53functions copy the value of the "inheritsched" attribute to the location pointed to by the second function parameter.
54.Sh RETURN VALUES
55If successful, these functions return 0.
56Otherwise, an error number is returned to indicate the error.
57.Sh ERRORS
58.Pp
59.Fn pthread_attr_getinheritsched
60will fail if:
61.Bl -tag -width Er
62.\" ========
63.It Bq Er EINVAL
64Invalid value for
65.Fa attr .
66.El
67.Pp
68.Fn pthread_attr_setinheritsched
69will fail if:
70.Bl -tag -width Er
71.\" ========
72.It Bq Er EINVAL
73Invalid value for
74.Fa attr .
75.El
76.Sh BUGS
77.Pp
78The "inheritsched" attribute has no effect on Darwin. It is provided for compatibility only.
79.Sh SEE ALSO
80.Xr pthread_create 3 ,
81.Xr pthread_attr_init 3 ,
82.Xr pthread_attr_setschedparam 3
83.Sh STANDARDS
84.Pp
85.Fn pthread_attr_setinheritsched ,
86.Fn pthread_attr_getinheritsched
87conform to
88.St -susv2