This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: linuxthreads question


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   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]