]> git.saurik.com Git - apple/libc.git/blame - pthreads/pthread_attr_set_getschedparam.3
Libc-763.13.tar.gz
[apple/libc.git] / pthreads / pthread_attr_set_getschedparam.3
CommitLineData
34e8f829
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_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
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
28.Fn pthread_attr_getschedparam
29and
30.Fn pthread_attr_setschedparam
31get and set the scheduling parameters within the
32.Fa attr
33argument. See
34.Fd /usr/include/sched.h
35for the definition of
36.Fa struct sched_param .
37The
38.Fa sched_priority
39field of
40.Fa struct sched_param
41can be set to SCHED_OTHER, SCHED_FIFO and SCHED_RR.
42.Sh RETURN VALUES
43If successful, these functions return 0.
44Otherwise, an error number is returned to indicate the error.
45.Fn pthread_attr_getschedparam ,
46on success, will copy the value of the thread's scheduling parameter attribute
47to the location pointed to by the second function parameter.
48.Sh ERRORS
49.Pp
50.Fn pthread_attr_getschedparam
51will fail if:
52.Bl -tag -width Er
53.\" ========
54.It Bq Er EINVAL
55Invalid value for
56.Fa attr .
57.\" ========
58.El
59.Pp
60.Fn pthread_attr_setschedparam
61will fail if:
62.Bl -tag -width Er
63.\" ========
64.It Bq Er EINVAL
65Invalid value for
66.Fa attr .
67.\" ========
68.It Bq Er ENOTSUP
69Invalid 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
80conform to
81.St -susv2