diff options
author | Roland McGrath <roland@gnu.org> | 1994-10-24 04:47:22 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1994-10-24 04:47:22 +0000 |
commit | 35baa98696ad90ad7045b666b155ac8cf33ff2a9 (patch) | |
tree | 4eaab676e453251f59102cde6342c9f23e85646c | |
parent | c503b0172e7899d77fc6fe2ab3410aa863ed80fa (diff) |
(NICE_TO_MACH_PRIORITY, MACH_PRIORITY_TO_NICE): New macros.
-rw-r--r-- | hurd/hurd/resource.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/hurd/hurd/resource.h b/hurd/hurd/resource.h index 071423627c..4a9e051d72 100644 --- a/hurd/hurd/resource.h +++ b/hurd/hurd/resource.h @@ -28,11 +28,21 @@ extern struct rlimit _hurd_rlimits[RLIM_NLIMITS]; extern struct mutex _hurd_rlimit_lock; /* Locks _hurd_rlimits. */ -/* Helper function for getpriority and setpriority. - Maps FUNCTION over all the processes specified by WHICH and WHO. - Returns FUNCTION's result the first time it returns nonzero. - If FUNCTION never returns nonzero, this returns zero. */ +/* Helper function for getpriority and setpriority. Maps FN over all the + processes specified by WHICH and WHO. PI is non-null if a + proc_getprocinfo was already done; FN may use *PI arbitrarily, it is + reset on the next call. Returns FN's result the first time it returns + nonzero. If FN never returns nonzero, this returns zero. */ extern error_t _hurd_priority_which_map (enum __priority_which which, int who, - error_t (*function) (pid_t)); + error_t (*fn) (pid_t pid, + struct procinfo *pi)); + +/* Convert between Mach priority values and the priority + values used by getpriority, setpriority, and nice. */ +#define MACH_PRIORITY_TO_NICE(prio) (2 * ((prio) - 12)) +#define NICE_TO_MACH_PRIORITY(nice) (12 + ((nice) / 2)) + + + #endif |