getpriority problem

getpriority problem

Post by Floyd Walk » Thu, 06 Mar 1997 04:00:00



I was trying to install sh-utils 1.16, and make check failed on 'nice'
Anyway, after some investigation, I think I have found a problem.

I wrote this program:

--begin--
#include <sys/time.h>
#include <sys/resource.h>

int getpriority(int which, int who);

void main ()
{
  int A;
  A = getpriority(PRIO_PROCESS, 0);
  printf("PRIORITY = %d\n",A);

Quote:}

--end--

This should return 0, but it always seems to return -5.  I have tried this
on a sun as well as linux 1.2.1.  I have not yet tried the 2.1.x kernels,
because I was in the process of upgrading when I came across this.

-Floyd

--
Brother Floyd                          "Today is a good day to die."
The High Believer                      "Do you believe?"

 
 
 

getpriority problem

Post by Matthew Wilc » Tue, 18 Mar 1997 04:00:00


: I was trying to install sh-utils 1.16, and make check failed on 'nice'
: Anyway, after some investigation, I think I have found a problem.

: This should return 0, but it always seems to return -5.  I have tried this
: on a sun as well as linux 1.2.1.  I have not yet tried the 2.1.x kernels,
: because I was in the process of upgrading when I came across this.

This returns 0 under both 2.0.29 and 2.1.29.  Did you possibly upgrade
your libraries?

--
It's only work if someone makes you do it.

Matthew Wilcox - reluctant comp.sys.acorn.programmer FAQ maintainer
Beta version available from ftp.barnet.ac.uk:/pub/Acorn/programm.FAQ
My email and news postings reflect someone's opinions.  Probably.

 
 
 

1. the use of getpriority and setpriority

Folks,

I am using linux 2.2.26 and I would like to use setpriority to change
the base time quantum to 50ms (5 ticks). I think the  scale of -20 to
19 in setpriority and the scale 0-40 internal confuses me. I went into
sys_setpriority() and I think I should use setpriority(15) rather than
setpriority(5). Using setpriority(15) it should change it to 5. But
when I call getpriority, it gives me 15. In sys_getpriority, it
somehow says that it adds 20 to the priority  to return a vaule
between 0-40, which is not. I am not sure how this works?

Jenny

2. linux partition overlaps

3. Solaris equivalent to SunOS getpriority/setpriority

4. telnet howto?

5. about getpriority and setpriority

6. NEW USERS: Where to find the Linux FAQ (please read)

7. setpriority(...), getpriority(..), nice(.)

8. Mozilla and their cvs server

9. problems, problems, 37.5 GB, problems, 1024, problems...

10. Installation problems, problems, problems!

11. PPP stands for Problem Problem Problem

12. Problems... problems ... more problems

13. Problems, Problems, Problems