]> git.saurik.com Git - apple/libpthread.git/blob - man/pthread_attr_set_getschedparam.3
libpthread-330.230.1.tar.gz
[apple/libpthread.git] / man / 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 must be within the range returned by the
42 .Xr sched_get_priority_min 2
43 and
44 .Xr sched_get_priority_max 2
45 system calls.
46 .Sh RETURN VALUES
47 If successful, these functions return 0.
48 Otherwise, an error number is returned to indicate the error.
49 .Fn pthread_attr_getschedparam ,
50 on success, will copy the value of the thread's scheduling parameter attribute
51 to the location pointed to by the second function parameter.
52 .Sh ERRORS
53 .Pp
54 .Fn pthread_attr_getschedparam
55 will fail if:
56 .Bl -tag -width Er
57 .\" ========
58 .It Bq Er EINVAL
59 Invalid value for
60 .Fa attr .
61 .\" ========
62 .El
63 .Pp
64 .Fn pthread_attr_setschedparam
65 will fail if:
66 .Bl -tag -width Er
67 .\" ========
68 .It Bq Er EINVAL
69 Invalid value for
70 .Fa attr .
71 .\" ========
72 .It Bq Er ENOTSUP
73 Invalid value for
74 .Fa param .
75 .El
76 .Sh SEE ALSO
77 .Xr pthread_create 3 ,
78 .Xr pthread_attr_init 3 ,
79 .Xr pthread_attr_setinheritsched 3
80 .Sh STANDARDS
81 .Pp
82 .Fn pthread_attr_setschedparam ,
83 .Fn pthread_attr_getschedparam
84 conform to
85 .St -susv2