Main index | Section 2 | Options |
#include <sys/rctl.h>
The rctl_add_rule() function adds the rule pointed to by inbufp to the resource limits database. The outbufp and outbuflen arguments are unused. Rule format is as described in rctl(8), with exceptions noted in the RULES AND FILTERS section.
The rctl_get_limits() function returns in outbufp a comma-separated list of rules that apply to the process that matches the filter specified in inbufp. This includes rules with a subject of the process itself as well as rules with a different subject (such as user or loginclass) that apply to the process.
The rctl_get_racct() function returns resource usage information for a given subject. The subject is specified by passing a filter in inbufp. Filter syntax is as described in rctl(8), with exceptions noted in the RULES AND FILTERS section. A comma-separated list of resources and the amount used of each by the specified subject is returned in outbufp. The resource and amount is formatted as "resource=amount".
The rctl_get_rules() function returns in outbufp a comma-separated list of rules from the resource limits database that match the filter passed in inbufp. Filter syntax is as described in rctl(8), with exceptions noted in the RULES AND FILTERS section. A filter of :: may be passed to return all rules.
The rctl_remove_rule() function removes all rules matching the filter passed in inbufp from the resource limits database. Filter syntax is as described in rctl(8), with exceptions noted in the RULES AND FILTERS section. outbufp and outbuflen are unused.
The subject must be fully specified. For example, abbreviating ‘user’ to ‘u’ is not acceptable. | |
User and group IDs must be numeric. For example, ‘root’ must be expressed as ‘0’. | |
Units are not permitted on resource amounts. For example, a quantity of 1024 bytes must be expressed as ‘1024’ and not ‘1k’. | |
[ENOSYS] | |
RACCT/RCTL support is not present in the kernel or the kern.racct.enable sysctl is 0. | |
[EINVAL] | |
The rule or filter passed in inbufp is invalid. | |
[EPERM] | |
User has insufficient privileges to carry out the requested operation. | |
[E2BIG] | |
inbufp or outbufp are too large. | |
[ESRCH] | |
No process matched the provided rule or filter. | |
[ENAMETOOLONG] | |
The loginclass or jail name specified is too long. | |
[ERANGE] | |
The rule amount is outside of the allowable range or outbufp is too small. | |
[EOPNOTSUPP] | |
The requested operation is not supported for the given rule or filter. | |
[EFAULT] | |
inbufp or outbufp refer to invalid addresses. | |
RCTL_ADD_RULE (2) | September 14, 2016 |
Main index | Section 2 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | How do you pronounce UNIX ? You Nix ! | ” |