Both of these functions can fail with the following error:
ESRCH
No thread with the ID thread could be found.
pthread_setschedparam
() may additionally fail with the following
errors:
EINVAL
policy is not a recognized policy, or param does not make
sense for the policy.
EPERM
The caller does not have appropriate privileges to set the
specified scheduling policy and parameters.
POSIX.1 also documents an ENOTSUP
("attempt was made to set the
policy or scheduling parameters to an unsupported value") error
for pthread_setschedparam
().