1

The man-page to getrlimit(RLIMIT_NICE, &rlim) says on successful return rlim.rlim_cur (and rlim.rlim_cur) will contain a value in the range of 1 to 40 or RLIM_INFINITY (which I think is (unsigned long)-1), but instead it always contains 0 for me. What does 0 mean here?

I tried to do change the limits using ulimit -Se10 but that just gives me ulimit: scheduling priority: cannot modify limit: Invalid argument for positive values and ulimit: -1: invalid number for negative values. (I guess it also wants the 1 to 40 range instead of the -20 to +19 range?) Only ulimit -Se0 is ok, but useless. (That is for user and for root.)

What I actually want to do: Find out if I can setpriority() to a certain value, but don't actually set it to the value. It will be set to that value after a fork() (well, after two forks where I want to keep the parent in the current priority). But I want to report a possible error as early as possible.

panzi
  • 7,517
  • 5
  • 42
  • 54

0 Answers0