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/types.h> /* types needed by quota.h */
47 .Fd #include <sys/quota.h> /* for disk quotas */
49 .Fn quotactl "const char *path" "int cmd" "int id" "char *addr"
53 call enables, disables and
54 manipulates filesystem quotas.
55 A quota control command
58 operates on the given filename
62 The address of an optional command specific data structure,
64 may be given; its interpretation
65 is discussed below with each command.
67 Currently quotas are supported only for the "ffs" and "hfs" filesystems.
68 A command is composed of a primary command (see below)
69 and a command type used to interpret the
71 Types are supported for interpretation of user identifiers
72 and group identifiers.
73 The specific commands are:
74 .Bl -tag -width Q_QUOTASTAT
76 Enable disk quotas for the filesystem specified by
78 The command type specifies the type of the quotas being enabled.
81 argument specifies a file from which to take the quotas.
82 The quota file must exist;
83 it is normally created with the
89 Only the super-user may turn quotas on.
91 Disable disk quotas for the filesystem specified by
93 The command type specifies the type of the quotas being disabled.
99 Only the super-user may turn quotas off.
101 Get disk quota limits and current usage for the user or group
102 (as determined by the command type) with identifier
109 Set disk quota limits for the user or group
110 (as determined by the command type) with identifier
116 The usage fields of the
118 structure are ignored.
119 This call is restricted to the super-user.
121 Set disk usage limits for the user or group
122 (as determined by the command type) with identifier
128 Only the usage fields are used.
129 This call is restricted to the super-user.
131 Update the on-disk copy of quota usages.
132 The command type specifies which type of quotas are to be updated.
137 parameters are ignored.
139 Get the enable status for the filesystem specified by
141 The command type specifies the type of the quotas whose
142 status is being queried.
144 is a pointer to an integer. Upon return,
145 this integer will hold a zero value if quotas for the
146 given type are not enabled and a non-zero value if
147 quotas for the given type are enabled.
150 parameter is ignored.
153 A successful call returns 0,
154 otherwise the value -1 is returned and the global variable
156 indicates the reason for the failure.
163 The kernel has not been compiled with the
167 The quota table cannot be expanded.
170 or the command type is invalid.
174 the quota file is not a plain file.
176 Search permission is denied for a component of a path prefix.
178 A component of a path prefix was not a directory.
179 .It Bq Er ENAMETOOLONG
180 A component of a pathname exceeded
182 characters, or an entire path name exceeded
186 A filename does not exist.
188 Too many symbolic links were encountered in translating a pathname.
192 the quota file resides on a read-only filesystem.
196 error occurred while reading from or writing
197 to a file containing quotas.
201 was supplied; the associated structure could not be copied in or out
205 points outside the process's allocated address space.
207 The call was privileged and the caller was not the super-user.
217 There should be some way to integrate this call with the resource
218 limit interface provided by
225 function call appeared in