1PTHREAD_SETSCHEDPRIO(3)    Linux Programmer's Manual   PTHREAD_SETSCHEDPRIO(3)
2
3
4

NAME

6       pthread_setschedprio - set scheduling priority of a thread
7

SYNOPSIS

9       #include <pthread.h>
10
11       pthread_setschedprio(pthread_t thread, int prio);
12
13       Compile and link with -pthread.
14

DESCRIPTION

16       The pthread_setschedprio() function sets the scheduling priority of the
17       thread  thread  to  the  value  specified  in   prio.    (By   contrast
18       pthread_setschedparam(3)  changes both the scheduling policy and prior‐
19       ity of a thread.)
20

RETURN VALUE

22       On success, this function returns 0; on error, it  returns  a  non-zero
23       error number.  If pthread_setschedprio() fails, the scheduling priority
24       of thread is not changed.
25

ERRORS

27       EINVAL prio is not valid for the scheduling  policy  of  the  specified
28              thread.
29
30       EPERM  The caller does not have appropriate privileges to set the spec‐
31              ified priority.
32
33       ESRCH  No thread with the ID thread could be found.
34
35       POSIX.1-2001 also documents an ENOTSUP ("attempt was made  to  set  the
36       priority to an unsupported value") error for pthread_setschedparam().
37

VERSIONS

39       This function is available in glibc since version 2.3.4.
40

CONFORMING TO

42       POSIX.1-2001.
43

NOTES

45       For  a  description  of the permissions required to, and the effect of,
46       changing a thread's scheduling priority, and details of  the  permitted
47       ranges  for  priorities  in each scheduling policy, see sched_setsched‐
48       uler(2).
49

SEE ALSO

51       getrlimit(2),     sched_get_priority_min(2),     sched_setscheduler(2),
52       pthread_attr_init(3),                  pthread_attr_setinheritsched(3),
53       pthread_attr_setschedparam(3),          pthread_attr_setschedpolicy(3),
54       pthread_setschedparam(3),      pthread_create(3),      pthread_self(3),
55       pthreads(7)
56

COLOPHON

58       This page is part of release 3.22 of the Linux  man-pages  project.   A
59       description  of  the project, and information about reporting bugs, can
60       be found at http://www.kernel.org/doc/man-pages/.
61
62
63
64Linux                             2008-11-06           PTHREAD_SETSCHEDPRIO(3)
Impressum