1 .\" Copyright (c) 2016 Eric Badger
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .Dd September 14, 2016
34 .Nd manipulate and query the resource limits database
41 .Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen"
45 .Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen"
49 .Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen"
53 .Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen"
57 .Fa "const char *inbufp" "size_t inbuflen" "char *outbufp" "size_t outbuflen"
60 These system calls are used to manipulate and query the resource limits
64 refers to the length of the buffer pointed to by
68 refers to the length of the buffer pointed to by
73 function adds the rule pointed to by
75 to the resource limits database.
81 Rule format is as described in
83 with exceptions noted in the
91 a comma-separated list of rules that apply to the process that
92 matches the filter specified in
94 This includes rules with a subject of the process itself as well as rules
95 with a different subject (such as user or loginclass) that apply to the
100 function returns resource usage information for a given subject.
101 The subject is specified by passing a filter in
103 Filter syntax is as described in
105 with exceptions noted in the
106 .Sx RULES AND FILTERS
108 A comma-separated list of resources and the amount used of each by the
109 specified subject is returned in
111 The resource and amount is formatted as
112 .Qq resource=amount .
118 a comma-separated list of rules from the resource limits database that
119 match the filter passed in
121 Filter syntax is as described in
123 with exceptions noted in the
124 .Sx RULES AND FILTERS
128 may be passed to return all rules.
132 function removes all rules matching the filter passed in
134 from the resource limits database.
135 Filter syntax is as described in
137 with exceptions noted in the
138 .Sx RULES AND FILTERS
144 .Sh RULES AND FILTERS
145 This section explains how the rule and filter format described in
147 differs from the format passed to the system calls themselves.
148 The rctl tool provides several conveniences that the system calls do not.
149 When using the system call:
150 .Bl -dash -offset indent
152 The subject must be fully specified.
153 For example, abbreviating
159 User and group IDs must be numeric.
165 Units are not permitted on resource amounts.
166 For example, a quantity of 1024 bytes must be expressed as
174 The rctl system calls may fail if:
177 RACCT/RCTL support is not present in the kernel or the
178 .Va kern.racct.enable
181 The rule or filter passed in
185 User has insufficient privileges to carry out the requested operation.
192 No process matched the provided rule or filter.
193 .It Bq Er ENAMETOOLONG
194 The loginclass or jail name specified is too long.
196 The rule amount is outside of the allowable range or
200 The requested operation is not supported for the given rule or filter.
205 refer to invalid addresses.
210 The rctl family of system calls appeared in
214 The rctl system calls were developed by
215 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
216 under sponsorship from the FreeBSD Foundation.
217 This manual page was written by
218 .An Eric Badger Aq Mt badger@FreeBSD.org .