linuxthreads question
Ulrich Drepper
drepper@cygnus.com
Tue Jul 14 18:09:00 GMT 1998
Zack Weinberg <zack@rabi.phys.columbia.edu> writes:
> The pthread_attr_setschedpolicy function returns ENOTSUP if you try to
> set a realtime scheduling policy and you aren't the superuser.
> Shouldn't that be EPERM?
No.
> Also, this check seems a bit questionable,
> since (a) the kernel will enforce the restriction at pthread_create()
> time, and process privileges may change between initializing the
> attribute object and creating threads with it; (b) POSIX capability
> support means the kernel's idea of who is allowed to do this is different.
Well, this can be interpreted in the one or other way. POSIX says:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ENOTSUP]
An attempt was made to set the attribute to an unsupported value.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Whether the value is not supported at all or only in the current
situation is not said.
We'll have to change the code once capabilities etc are available but
I think for now the code is ok.
> (N.B. pthread_start_thread() doesn't bother to check for errors on the
> call to __sched_setscheduler, which is just wrong.)
Yep, but it's not easy to fix...
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
More information about the Libc-hacker
mailing list