1

I am running centos 6.6 on same type of hardware with kernel version "2.6.32-504.30.3.el6.x86_64"

Has anybody seen this why the below code when compiled and executed gives a different value on two different hosts (of same hardware class). The different value being 0 or 19.

 #include <sys/resource.h>
 #include <errno.h>
 #include <stdio.h>

int main()
{
        int prio;
        int incr;

        errno = 0;
        prio = getpriority(PRIO_PROCESS, 0);
        printf("%d is prio \n", prio);
}

host 1:

$ gcc -o mynice mynice.c
$ ./mynice
0 is prio
$

host 2:

$ scp host1:~/mynice ~/
$ ./mynice
19 is prio

I have checked my limits.conf and others under /etc/security and I did not see anything interesting that differ about this in any config files either.

Output of ulimit -a on both the machines for the user has no difference.

8
  • what are actual limits do ulimit -a show? Please include the output into your post. – user140866 Jan 31 '16 at 3:35
  • Just added the note that output of 'ulimit -a' has no difference for the same user on different machines. @siblynx please do let me know if you meant the same thing – Nikhil Mulley Feb 3 '16 at 6:52
  • @gilles any ideas? – Nikhil Mulley Feb 3 '16 at 6:53
  • OK not related to limits in any way, you just have a forced 19 nice value on host 2. – user140866 Feb 3 '16 at 10:59
  • Check the output of ps -eHo nice,pid,args to see at which level in your ancestry the niceness was set to 19 which could give you a clue to what did it. – Stéphane Chazelas Feb 3 '16 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.