1 .\" Copyright (c) 1983, 1990, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Robert Elz at The University of Melbourne.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\" may be used to endorse or promote products derived from this software
17 .\" without specific prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" @(#)quotactl.2 8.2 (Berkeley) 3/10/95
39 .Nd manipulate file system quotas
46 .Fn quotactl "const char *path" "int cmd" "int id" "void *addr"
50 system call enables, disables and
51 manipulates file system quotas.
52 A quota control command
55 operates on the given filename
57 for the given user or group
59 (NOTE: One should use the QCMD macro defined in
61 to formulate the value for
63 The address of an optional command specific data structure,
65 may be given; its interpretation
66 is discussed below with each command.
68 For commands that use the
70 identifier, it must be either -1 or any positive value.
71 The value of -1 indicates that the current UID or GID should be used.
72 Any other negative value will return an error.
74 Currently quotas are supported only for the
79 a command is composed of a primary command (see below)
80 and a command type used to interpret the
82 Types are supported for interpretation of user identifiers (USRQUOTA)
83 and group identifiers (GRPQUOTA).
86 specific commands are:
87 .Bl -tag -width Q_GETQUOTASIZEx
89 Enable disk quotas for the file system specified by
91 The command type specifies the type of the quotas being enabled.
94 argument specifies a file from which to take the quotas.
95 The quota file must exist;
96 it is normally created with the
102 Only the super-user may turn quotas on.
104 Disable disk quotas for the file system specified by
106 The command type specifies the type of the quotas being disabled.
111 arguments are unused.
112 Only the super-user may turn quotas off.
113 .It Dv Q_GETQUOTASIZE
114 Get the wordsize used to represent the quotas for the user or group
115 (as determined by the command type).
116 Possible values are 32 for the old-style quota file
117 and 64 for the new-style quota file.
120 argument is a pointer to an integer into which the size is stored.
125 Get disk quota limits and current usage for the user or group
126 (as determined by the command type) with identifier
133 structure (defined in
134 .In ufs/ufs/quota.h ) .
136 Set disk quota limits for the user or group
137 (as determined by the command type) with identifier
144 structure (defined in
145 .In ufs/ufs/quota.h ) .
146 The usage fields of the
148 structure are ignored.
149 This system call is restricted to the super-user.
151 Set disk usage limits for the user or group
152 (as determined by the command type) with identifier
159 structure (defined in
160 .In ufs/ufs/quota.h ) .
161 Only the usage fields are used.
162 This system call is restricted to the super-user.
164 Update the on-disk copy of quota usages.
165 The command type specifies which type of quotas are to be updated.
170 arguments are ignored.
177 system call will fail if:
180 The kernel has not been compiled with the
184 The quota table cannot be expanded.
189 or the command type is invalid.
196 quotas are not currently enabled for this file system.
209 the quota file is not a plain file.
211 Search permission is denied for a component of a path prefix.
213 A component of a path prefix was not a directory.
214 .It Bq Er ENAMETOOLONG
215 A component of either pathname exceeded 255 characters,
216 or the entire length of either path name exceeded 1023 characters.
218 A filename does not exist.
220 Too many symbolic links were encountered in translating a pathname.
224 either the file system on which quotas are to be enabled is mounted read-only
225 or the quota file resides on a read-only file system.
229 error occurred while reading from or writing
230 to a file containing quotas.
232 Corrupted data was detected while reading from the file system.
236 was supplied; the associated structure could not be copied in or out
242 points outside the process's allocated address space.
244 The call was privileged and the caller was not the super-user.
256 system call appeared in
259 There should be some way to integrate this call with the resource
260 limit interface provided by