First public contribution.
1 /** @file ../include/sys/resource.h
5 /** @fn getpriority(int which, int who)
9 Note: This description also covers the following functions -
12 @return Since getpriority can legitimately return the value -1, it is necessary
13 to clear the external variable errno prior to the
14 call, then check it afterward to determine
15 if a -1 is an error or a legitimate value. The setpriority returns 0 on success and -1 on error with the errno set.
18 priority of the process, process group, or user, as indicated by which and who is obtained with the getpriority system call and set with the setpriority system call.
20 is one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and who is interpreted relative to which (a process identifier for PRIO_PROCESS, process group
21 identifier for PRIO_PGRP, and a user ID for PRIO_USER ). A zero value of who denotes the current process, process group, or user.
23 is a value in the range -20 to 20.
24 The default priority is 0;
25 lower priorities cause more favorable scheduling.
29 If the prio is greater than the greatest priority supported, it is set to the greatest priority supported.
30 If the prio is lesser than the least priority supported, it is set to the least priority supported.
34 #include<sys/resource.h>
37 int test_getpriority()
41 retVal = getpriority(PRIO_PROCESS, 0);
42 if((retVal == -1) && (errno == ENOSYS))
49 printf("getpriority passed");
51 priority = %d ", retVal);
64 #include<sys/resource.h>
67 int test_setpriority()
71 retVal = setpriority(PRIO_PROCESS, 0, 0);
73 if((retVal == -1) && (errno == ENOSYS))
80 printf("Setpriority passed");
81 printf(" getpriority now: %d", getpriority(PRIO_PROCESS,0))
96 1. The values PRIO_PGRP and PRIO_USER for the which and any value other than 0 for who are not supported, when given return ENOSYS.
97 2. To effectively increase or decrease the priority of the process, one should consider the following:
98 Highest -16 to -20 Above Normal -6 to -15 Normal +4 to -5 Below Normal +14 to +5 Lowest +20 to +15 3.
99 The setting of the priority to values -16 to -20 is not supported, the use of which sets errno to EINVAL.
107 @externallyDefinedApi
110 /** @fn setpriority(int which, int who, int value)
115 Refer to getpriority() for the documentation
123 @externallyDefinedApi
129 Contains the following members,
132 @externallyDefinedApi
135 /** @var rlimit::rlim_cur
139 /** @var rlimit::rlim_max
140 maximum value for rlim_cur
145 Contains the following members,
148 @externallyDefinedApi
151 /** @var rusage::ru_utime
155 /** @var rusage::ru_stime
159 /** @var rusage::ru_maxrss
160 max resident set size
163 /** @var rusage::ru_ixrss
164 integral shared memory size
167 /** @var rusage::ru_idrss
168 integral unshared data
171 /** @var rusage::ru_isrss
172 integral unshared stack
175 /** @var rusage::ru_minflt
179 /** @var rusage::ru_majflt
183 /** @var rusage::ru_nswap
187 /** @var rusage::ru_inblock
188 block input operations
191 /** @var rusage::ru_oublock
192 block output operations
195 /** @var rusage::ru_msgsnd
199 /** @var rusage::ru_msgrcv
203 /** @var rusage::ru_nsignals
207 /** @var rusage::ru_nvcsw
208 voluntary context switches
211 /** @var rusage::ru_nivcsw
216 /** @typedef typedef __rlim_t rlim_t
218 Unsigned integer type used for limit values.
221 @externallyDefinedApi
225 /** @def RLIM_INFINITY
230 @externallyDefinedApi
238 @externallyDefinedApi
243 cpu time in milliseconds
246 @externallyDefinedApi
254 @externallyDefinedApi
257 /** @def RLIMIT_FSIZE
262 @externallyDefinedApi
266 /** @def RLIMIT_NOFILE
271 @externallyDefinedApi
274 /** @def RLIMIT_STACK
279 @externallyDefinedApi
284 standard name for RLIMIT_VMEM
287 @externallyDefinedApi
292 Resource utilization information.
295 @externallyDefinedApi
298 /** @def RUSAGE_CHILDREN
300 Resource utilization information.
303 @externallyDefinedApi
307 /** @def PRIO_PROCESS
309 Process priority specifications to get or set priority.
312 @externallyDefinedApi
317 Process priority specifications to get or set priority.
320 @externallyDefinedApi
325 Process priority specifications to get or set priority.
328 @externallyDefinedApi