[PATCH roland/nptl] NPTL: Don't (re)validate sched_priority in pthread_create.

Roland McGrath roland@hack.frob.com
Thu Nov 20 18:59:00 GMT 2014


> > I've written up a test for the expected EINVAL diagnosis.  It depends
> > on constructing a pthread_attr_t with invalid scheduling parameters,
> > which AFAIK is possible only by using pthread_attr_setschedparam while
> > the pthread_attr_t is set to one scheduling policy where a given
> > struct sched_param is valid and then using pthread_attr_setschedpolicy
> > to switch it to a policy where those values are invalid.  This
> > requires some assumptions about the policies and their parameters, but
> > those are predictable enough at least for Linux.
> 
> Should this even be possible?

I can't see how it could be ruled out.  
POSIX doesn't put any requirements on the order in which you call
pthread_attr_setschedparam and pthread_attr_setschedpolicy.



More information about the Libc-alpha mailing list