This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: linuxthreads question
- To: Zack Weinberg <zack@rabi.phys.columbia.edu>
- Subject: Re: linuxthreads question
- From: Ulrich Drepper <drepper@cygnus.com>
- Date: 14 Jul 1998 18:06:20 -0700
- Cc: libc-hacker@cygnus.com
- References: <199807120353.XAA01406@rabi.phys.columbia.edu>
- Reply-To: drepper@cygnus.com (Ulrich Drepper)
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 `------------------------