]> git.saurik.com Git - apple/libpthread.git/blob - man/pthread_attr_set_getinheritsched.3
libpthread-105.10.1.tar.gz
[apple/libpthread.git] / man / pthread_attr_set_getinheritsched.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_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
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 One of the thread attributes of interest is the "inheritsched" attribute. This attribute
29 controls 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
32 PTHREAD_INHERIT_SCHED
33 .Pp
34 Indicates that the newly created thread should inherit all it's scheduling related attributes from it's creating
35 thread. It ignores the values of the relevant attributes within the
36 .Fa attr
37 argument.
38 .Pp
39 PTHREAD_EXPLICIT_SCHED
40 .Pp
41 Indicates that the newly created thread should set it's scheduling related attributes based on
42 .Fa attr
43 argument.
44 .Pp
45 The
46 .Fn pthread_attr_setinheritsched
47 functions set the "inheritsched" attribute within the
48 .Fa attr
49 argument to the desired value.
50 .Pp
51 The
52 .Fn pthread_attr_getinheritsched
53 functions copy the value of the "inheritsched" attribute to the location pointed to by the second function parameter.
54 .Sh RETURN VALUES
55 If successful, these functions return 0.
56 Otherwise, an error number is returned to indicate the error.
57 .Sh ERRORS
58 .Pp
59 .Fn pthread_attr_getinheritsched
60 will fail if:
61 .Bl -tag -width Er
62 .\" ========
63 .It Bq Er EINVAL
64 Invalid value for
65 .Fa attr .
66 .El
67 .Pp
68 .Fn pthread_attr_setinheritsched
69 will fail if:
70 .Bl -tag -width Er
71 .\" ========
72 .It Bq Er EINVAL
73 Invalid value for
74 .Fa attr .
75 .El
76 .Sh SEE ALSO
77 .Xr pthread_create 3 ,
78 .Xr pthread_attr_init 3 ,
79 .Xr pthread_attr_setschedparam 3
80 .Sh STANDARDS
81 .Pp
82 .Fn pthread_attr_setinheritsched ,
83 .Fn pthread_attr_getinheritsched
84 conform to
85 .St -susv2