]>
Commit | Line | Data |
---|---|---|
28f540f4 | 1 | /* Resource limits for the Hurd. |
c84142e8 UD |
2 | Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. |
3 | This file is part of the GNU C Library. | |
28f540f4 | 4 | |
c84142e8 | 5 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
6 | modify it under the terms of the GNU Lesser General Public |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
28f540f4 | 9 | |
c84142e8 UD |
10 | The GNU C Library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 13 | Lesser General Public License for more details. |
28f540f4 | 14 | |
41bdb6e2 | 15 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
16 | License along with the GNU C Library; if not, see |
17 | <http://www.gnu.org/licenses/>. */ | |
28f540f4 RM |
18 | |
19 | #ifndef _HURD_RESOURCE_H | |
20 | #define _HURD_RESOURCE_H | |
21 | ||
22 | #include <sys/types.h> | |
23 | #include <sys/resource.h> | |
24 | #include <errno.h> | |
25 | #include <hurd/process.h> | |
26 | ||
27 | /* This array contains the current resource limits for the process. */ | |
28 | extern struct rlimit _hurd_rlimits[RLIM_NLIMITS]; | |
29 | extern struct mutex _hurd_rlimit_lock; /* Locks _hurd_rlimits. */ | |
30 | ||
31 | ||
32 | /* Helper function for getpriority and setpriority. Maps FN over all the | |
33 | processes specified by WHICH and WHO. PI is non-null if a | |
34 | proc_getprocinfo was already done; FN may use *PI arbitrarily, it is | |
80b55d32 RM |
35 | reset on the next call; PI_FLAGS is passed to proc_getprocinfo. Returns |
36 | FN's result the first time it returns nonzero. If FN never returns | |
37 | nonzero, this returns zero. */ | |
28f540f4 RM |
38 | extern error_t _hurd_priority_which_map (enum __priority_which which, int who, |
39 | error_t (*fn) (pid_t pid, | |
80b55d32 RM |
40 | struct procinfo *pi), |
41 | int pi_flags); | |
28f540f4 RM |
42 | |
43 | /* Convert between Mach priority values and the priority | |
44 | values used by getpriority, setpriority, and nice. */ | |
45 | #define MACH_PRIORITY_TO_NICE(prio) (2 * ((prio) - 12)) | |
46 | #define NICE_TO_MACH_PRIORITY(nice) (12 + ((nice) / 2)) | |
47 | ||
48 | ||
49 | ||
50 | ||
51 | #endif |