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