]> git.saurik.com Git - apple/libc.git/blob - pthreads/pthread_attr_set_getschedparam.3
Libc-763.13.tar.gz
[apple/libc.git] / pthreads / pthread_attr_set_getschedparam.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_getschedparam ,
7 .Nm pthread_attr_setschedparam
8 .Nd thread attribute operations
9 .Sh SYNOPSIS
10 .Fd #include <pthread.h>
11 .Ft int
12 .Fo pthread_attr_getschedparam
13 .Fa "const pthread_attr_t *restrict attr"
14 .Fa "struct sched_param *restrict param"
15 .Fc
16 .Ft int
17 .Fo pthread_attr_setschedparam
18 .Fa "pthread_attr_t *restrict attr"
19 .Fa "const struct sched_param *restrict param"
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 .Fn pthread_attr_getschedparam
29 and
30 .Fn pthread_attr_setschedparam
31 get and set the scheduling parameters within the
32 .Fa attr
33 argument. See
34 .Fd /usr/include/sched.h
35 for the definition of
36 .Fa struct sched_param .
37 The
38 .Fa sched_priority
39 field of
40 .Fa struct sched_param
41 can be set to SCHED_OTHER, SCHED_FIFO and SCHED_RR.
42 .Sh RETURN VALUES
43 If successful, these functions return 0.
44 Otherwise, an error number is returned to indicate the error.
45 .Fn pthread_attr_getschedparam ,
46 on success, will copy the value of the thread's scheduling parameter attribute
47 to the location pointed to by the second function parameter.
48 .Sh ERRORS
49 .Pp
50 .Fn pthread_attr_getschedparam
51 will fail if:
52 .Bl -tag -width Er
53 .\" ========
54 .It Bq Er EINVAL
55 Invalid value for
56 .Fa attr .
57 .\" ========
58 .El
59 .Pp
60 .Fn pthread_attr_setschedparam
61 will fail if:
62 .Bl -tag -width Er
63 .\" ========
64 .It Bq Er EINVAL
65 Invalid value for
66 .Fa attr .
67 .\" ========
68 .It Bq Er ENOTSUP
69 Invalid value for
70 .Fa param .
71 .El
72 .Sh SEE ALSO
73 .Xr pthread_create 3 ,
74 .Xr pthread_attr_init 3 ,
75 .Xr pthread_attr_setinheritsched 3
76 .Sh STANDARDS
77 .Pp
78 .Fn pthread_attr_setschedparam ,
79 .Fn pthread_attr_getschedparam
80 conform to
81 .St -susv2