(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / linuxthreads / man / pthread_setschedparam.man
blob3992927837111cf87ec294fdf0475cf0dbdd358d
1 .TH PTHREAD_SETSCHEDPARAM 3 LinuxThreads
3 .XREF pthread_getschedparam
5 .SH NAME
6 pthread_setschedparam, pthread_getschedparam \- control thread scheduling parameters
8 .SH SYNOPSIS
9 #include <pthread.h>
11 int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param *param);
13 int pthread_getschedparam(pthread_t target_thread, int *policy, struct sched_param *param);
15 .SH DESCRIPTION
17 !pthread_setschedparam! sets the scheduling parameters for the thread
18 |target_thread| as indicated by |policy| and |param|. |policy| can be
19 either !SCHED_OTHER! (regular, non-realtime scheduling), !SCHED_RR!
20 (realtime, round-robin) or !SCHED_FIFO! (realtime, first-in
21 first-out). |param| specifies the scheduling priority for the two
22 realtime policies.  See !sched_setpolicy!(2) for more information on
23 scheduling policies.
25 The realtime scheduling policies !SCHED_RR! and !SCHED_FIFO! are
26 available only to processes with superuser privileges.
28 !pthread_getschedparam! retrieves the scheduling policy and scheduling
29 parameters for the thread |target_thread| and store them in the
30 locations pointed to by |policy| and |param|, respectively.
32 .SH "RETURN VALUE"
33 !pthread_setschedparam! and !pthread_getschedparam! return 0 on
34 success and a non-zero error code on error.
36 .SH ERRORS
37 On error, !pthread_setschedparam! returns the following error codes:
38 .RS
39 .TP
40 !EINVAL!
41 |policy| is not one of !SCHED_OTHER!, !SCHED_RR!, !SCHED_FIFO!
43 .TP
44 !EINVAL!
45 the priority value specified by |param| is not valid for the specified policy
47 .TP
48 !EPERM!
49 the calling process does not have superuser permissions
51 .TP
52 !ESRCH!
53 the |target_thread| is invalid or has already terminated
55 .TP
56 !EFAULT!
57 |param| points outside the process memory space
58 .RE
60 On error, !pthread_getschedparam! returns the following error codes:
61 .RS
62 .TP
63 !ESRCH!
64 the |target_thread| is invalid or has already terminated
66 .TP
67 !EFAULT!
68 |policy| or |param| point outside the process memory space
69 .RE
71 .SH AUTHOR
72 Xavier Leroy <Xavier.Leroy@inria.fr>
74 .SH "SEE ALSO"
75 !sched_setscheduler!(2),
76 !sched_getscheduler!(2),
77 !sched_getparam!(2),
78 !pthread_attr_setschedpolicy!(3),
79 !pthread_attr_setschedparam!(3).