pthread_setschedprio(3C) sets the scheduling priority for the specified thread.
int pthread_setschedprio(pthread_t tid, int prio);
#include <pthread.h> pthread_t tid; int prio; int ret;
pthread_setschedprio() returns zero after completing successfully. Any other return value indicates that an error occurred. When the following condition occurs, the function fails and returns the corresponding value.
The value of prio is invalid for the scheduling policy of the specified thread.
An attempt was made to set the priority to an unsupported value.
The caller does not have the appropriate permission to set the scheduling priority of the specified thread.
The value specified by tid does not refer to an existing thread.