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.