On Wed, 27 Feb 2013 18:22:20 +0200 Hartmut Behrens <hartmut.behrens@xxxxxxxxx> wrote: > On Wed, Feb 27, 2013 at 6:09 PM, Clark Williams <williams@xxxxxxxxxx> wrote: > > What happens if you compile and run this program on your kernel? > > #include <stdio.h> > > #include <stdlib.h> > > #include <sched.h> > > #include <errno.h> > > #include <memory.h> > > > > int main(int argc, char **argv) > > { > > int ret; > > struct sched_param s; > > > > memset(&s, 0, sizeof(s)); > > s.sched_priority = 1; > > if ((sched_setscheduler(0, SCHED_FIFO, &s))) { > > fprintf(stderr, "error changing policy: %s\n", strerror(errno)); > > exit(errno); > > } > > printf("successfully changed policy to SCHED_FIFO priority 1\n"); > > exit(0); > > } > > When I run it as root I get "error changing policy: Operation not permitted". > > Does this mean that some hard limits are not correctly set for root? Well this is a new one on me. Some questions: Do you have SELinux running? Are there any files in /etc/security/limits.d other than the one you put there? Other than that I can't think of a reason why sched_setscheduler() would fail as root. Clark
Attachment:
signature.asc
Description: PGP signature