1 .\" $NetBSD: quotactl.2,v 1.23 2004/05/13 10:20:58 wiz 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. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" @(#)quotactl.2 8.2 (Berkeley) 3/10/95
40 .Nd manipulate filesystem quotas
46 .Fn quotactl "const char *path" "int cmd" "int id" "void *addr"
50 call enables, disables and
51 manipulates filesystem quotas.
52 A quota control command
55 operates on the given filename
59 The address of an optional command specific data structure,
61 may be given; its interpretation
62 is discussed below with each command.
64 Currently quotas are supported only for the ``ffs''
65 and ``lfs'' filesystem.
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 ``ffs'' and ``lfs'' specific commands are:
73 .Bl -tag -width Q_QUOTAON
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
106 structure (defined in
107 .Aq Pa ufs/ufs/quota.h ) .
109 Set disk quota limits for the user or group
110 (as determined by the command type) with identifier
115 structure (defined in
116 .Aq Pa ufs/ufs/quota.h ) .
117 The usage fields of the
119 structure are ignored.
120 This call is restricted to the super-user.
122 Set disk usage for the user or group
123 (as determined by the command type) with identifier
128 structure (defined in
129 .Aq Pa ufs/ufs/quota.h ) .
130 Only the usage fields are used.
131 This call is restricted to the super-user.
133 Update the on-disk copy of quota usages.
134 The command type specifies which type of quotas are to be updated.
139 parameters are ignored.
142 A successful call returns 0,
143 otherwise the value \-1 is returned and the global variable
145 indicates the reason for the failure.
152 The kernel has not been compiled with the
156 The quota table cannot be expanded.
159 or the command type is invalid.
163 the quota file is not a plain file, or
164 search permission is denied for a component of a path prefix.
166 A component of a path prefix was not a directory.
167 .It Bq Er ENAMETOOLONG
168 A component of a pathname exceeded
170 characters, or an entire path name exceeded
174 A filename does not exist.
176 Too many symbolic links were encountered in translating a pathname.
180 the quota file resides on a read-only filesystem.
184 error occurred while reading from or writing
185 to a file containing quotas.
188 points outside the process's allocated address space, or
191 was supplied; the associated structure could not be copied in or out
194 The call was privileged and the caller was not the super-user.
206 function call appeared in
209 There should be some way to integrate this call with the resource
210 limit interface provided by