1 .\" $NetBSD: quotactl.2,v 1.8 1995/02/27 12:35:43 cgd Exp $
3 .\" Copyright (c) 1983, 1990, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" This code is derived from software contributed to Berkeley by
7 .\" Robert Elz at The University of Melbourne.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\" must display the following acknowledgement:
19 .\" This product includes software developed by the University of
20 .\" California, Berkeley and its contributors.
21 .\" 4. Neither the name of the University nor the names of its contributors
22 .\" may be used to endorse or promote products derived from this software
23 .\" without specific prior written permission.
25 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 .\" @(#)quotactl.2 8.1 (Berkeley) 6/4/93
44 .Nd manipulate filesystem quotas
46 .Fd #include <sys/quota.h> /* for disk quotas */
48 .Fn quotactl "const char *path" "int cmd" "int id" "char *addr"
52 call enables, disables and
53 manipulates filesystem quotas.
54 A quota control command
57 operates on the given filename
61 The address of an optional command specific data structure,
63 may be given; its interpretation
64 is discussed below with each command.
66 Currently quotas are supported only for the "ffs" and "hfs" filesystems.
67 A command is composed of a primary command (see below)
68 and a command type used to interpret the
70 Types are supported for interpretation of user identifiers
71 and group identifiers.
72 The specific commands are:
73 .Bl -tag -width Q_QUOTASTAT
75 Enable disk quotas for the filesystem specified by
77 The command type specifies the type of the quotas being enabled.
80 argument specifies a file from which to take the quotas.
81 The quota file must exist;
82 it is normally created with the
88 Only the super-user may turn quotas on.
90 Disable disk quotas for the filesystem specified by
92 The command type specifies the type of the quotas being disabled.
98 Only the super-user may turn quotas off.
100 Get disk quota limits and current usage for the user or group
101 (as determined by the command type) with identifier
108 Set disk quota limits for the user or group
109 (as determined by the command type) with identifier
115 The usage fields of the
117 structure are ignored.
118 This call is restricted to the super-user.
120 Set disk usage limits for the user or group
121 (as determined by the command type) with identifier
127 Only the usage fields are used.
128 This call is restricted to the super-user.
130 Update the on-disk copy of quota usages.
131 The command type specifies which type of quotas are to be updated.
136 parameters are ignored.
138 Get the enable status for the filesystem specified by
140 The command type specifies the type of the quotas whose
141 status is being queried.
143 is a pointer to an integer. Upon return,
144 this integer will hold a zero value if quotas for the
145 given type are not enabled and a non-zero value if
146 quotas for the given type are enabled.
149 parameter is ignored.
152 A successful call returns 0,
153 otherwise the value -1 is returned and the global variable
155 indicates the reason for the failure.
162 The kernel has not been compiled with the
166 The quota table cannot be expanded.
169 or the command type is invalid.
173 the quota file is not a plain file.
175 Search permission is denied for a component of a path prefix.
177 A component of a path prefix was not a directory.
178 .It Bq Er ENAMETOOLONG
179 A component of a pathname exceeded
181 characters, or an entire path name exceeded
185 A filename does not exist.
187 Too many symbolic links were encountered in translating a pathname.
191 the quota file resides on a read-only filesystem.
195 error occurred while reading from or writing
196 to a file containing quotas.
200 was supplied; the associated structure could not be copied in or out
204 points outside the process's allocated address space.
206 The call was privileged and the caller was not the super-user.
216 There should be some way to integrate this call with the resource
217 limit interface provided by
224 function call appeared in