I have code that does the following:
Code:
struct sched_param p;
int policy = SCHED_FIFO;
p.sched_priority = 1;
if (sched_setscheduler(0, policy, &p) == -1) {
printf("Unable to set scheduler to SCHED_FIFO, errno=%d\n", errno);
exit(1);
}
I can run this code on one CentOS 7 system and the call to sched_setscheduler() completes successfully. The same call when run on another system fails with EPERM (operation not permitted). In both cases the code is run as root, and all of the settings I've checked appear to be the same between the two systems (e.g. /etc/security/limits.conf is identical on both systems, SELinux is disabled on both). Clearly though something is configured differently between the two systems and I cannot figure out what it is.
The manner in which the systems are installed is quite different, one being installed through the normal interactive CentOS 7 install tool and the other being installed by an automated kickstart script. The method of installation of course shouldn't make a difference.
Does anyone have any suggestions what the culprit might be?