]>
Commit | Line | Data |
---|---|---|
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_getschedpolicy , | |
7 | .Nm pthread_attr_setschedpolicy | |
8 | .Nd thread attribute operations | |
9 | .Sh SYNOPSIS | |
10 | .Fd #include <pthread.h> | |
11 | .Ft int | |
12 | .Fo pthread_attr_getschedpolicy | |
13 | .Fa "const pthread_attr_t *restrict attr" | |
14 | .Fa "int *restrict policy" | |
15 | .Fc | |
16 | .Ft int | |
17 | .Fo pthread_attr_setschedpolicy | |
18 | .Fa "pthread_attr_t *attr" | |
19 | .Fa "int policy" | |
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 functions | |
29 | .Fn pthread_attr_setschedpolicy | |
30 | and | |
31 | .Fn pthread_attr_getschedpolicy , | |
32 | set and get the attribute in the | |
33 | .Fa attr | |
34 | argument related to the scheduling policy. | |
35 | The value for the aforementioned attribute can be SCHED_FIFO, SCHED_RR and SCHED_OTHER. | |
36 | .Sh RETURN VALUES | |
37 | If successful, these functions return 0. | |
38 | Otherwise, an error number is returned to indicate the error. | |
39 | .Fn pthread_attr_getschedpolicy , | |
40 | on success, will copy the value of the thread's scheduling policy attribute | |
41 | to the location pointed to by the second function parameter. | |
42 | .Sh ERRORS | |
43 | .Pp | |
44 | .Fn pthread_attr_getschedpolicy | |
45 | will fail if: | |
46 | .Bl -tag -width Er | |
47 | .\" ======== | |
48 | .It Bq Er EINVAL | |
49 | Invalid value for | |
50 | .Fa attr . | |
51 | .El | |
52 | .Pp | |
53 | .Fn pthread_attr_setschedpolicy | |
54 | will fail if: | |
55 | .Bl -tag -width Er | |
56 | .\" ======== | |
57 | .It Bq Er EINVAL | |
58 | Invalid value for | |
59 | .Fa attr . | |
60 | .It Bq Er ENOTSUP | |
61 | Invalid or unsupported value for | |
62 | .Fa policy . | |
63 | .El | |
64 | .Sh SEE ALSO | |
65 | .Xr pthread_create 3 , | |
66 | .Xr pthread_attr_init 3 , | |
67 | .Xr pthread_attr_setschedparam 3 , | |
68 | .Xr pthread_attr_setinheritsched 3 | |
69 | .Sh STANDARDS | |
70 | .Fn pthread_attr_setschedpolicy , | |
71 | .Fn pthread_attr_getschedpolicy | |
72 | conform to | |
73 | .St -susv2 |