In nptl/pthread_attr_setschedpolicy.c there are the lines /* Catch invalid values. */ if (policy != SCHED_OTHER && policy != SCHED_FIFO && policy != SCHED_RR) return EINVAL; In pthread_setschedparam(), there is not an analogous check. This means that one can set, for example, a SCHED_BATCH policy with pthread_setschedparam(), but one can't initialize a thread attributes object that can be used to create a thread running under the SCHED_BATCH policy. This seems rather inconsistent. Either pthread_setschedparam() should place the same restriction as pthread_attr_setschedpolicy(), or the restriction should be removed from pthread_attr_setschedpolicy(). Given that the POSIX.1 specification of pthread_attr_setschedpolicy() says: The supported values of policy shall include SCHED_FIFO, SCHED_RR, and SCHED_OTHER, which are defined in the <sched.h> header. removing the restriction from pthread_attr_setschedpolicy() seems the more reasonable course, so that applications can take advantage of the additional scheduling policies provided by Linux.
*** Bug 10828 has been marked as a duplicate of this bug. ***