--- nptl/pthread_mutex_getprioceiling.c.orig 2006-06-19 01:53:09.079491221 +0200 +++ nptl/pthread_mutex_getprioceiling.c 2006-06-19 01:53:16.117261519 +0200 @@ -29,5 +29,14 @@ *prioceiling = (mutex->__data.__kind & PTHREAD_MUTEX_PRIO_CEILING_MASK) >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT; + /* In case we are out of range at the lower end (SCHED_FIFO can begin at 1 + and we are 0 by default) return the lowest possible value which is + how we _effectively_ behave like. */ + INTERNAL_SYSCALL_DECL (scerr); + int minprio = INTERNAL_SYSCALL (sched_get_priority_min, scerr, 1, + SCHED_FIFO); + if (*prioceiling < minprio) + *prioceiling = minprio; + return 0; } --- nptl/pthread_mutexattr_getprioceiling.c.orig 2006-06-19 01:52:55.121930006 +0200 +++ nptl/pthread_mutexattr_getprioceiling.c 2006-06-19 01:52:57.642489593 +0200 @@ -33,5 +33,14 @@ *prioceiling = ((iattr->mutexkind & PTHREAD_MUTEXATTR_PRIO_CEILING_MASK) >> PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT); + /* In case we are out of range at the lower end (SCHED_FIFO can begin at 1 + and we are 0 by default) return the lowest possible value which is + how we _effectively_ behave like. */ + INTERNAL_SYSCALL_DECL (scerr); + int minprio = INTERNAL_SYSCALL (sched_get_priority_min, scerr, 1, + SCHED_FIFO); + if (*prioceiling < minprio) + *prioceiling = minprio; + return 0; }