Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1983, 1990, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Robert Elz at The University of Melbourne. | |
6 | .\" | |
7 | .\" Redistribution and use in source and binary forms, with or without | |
8 | .\" modification, are permitted provided that the following conditions | |
9 | .\" are met: | |
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. All advertising materials mentioning features or use of this software | |
16 | .\" must display the following acknowledgement: | |
17 | .\" This product includes software developed by the University of | |
18 | .\" California, Berkeley and its contributors. | |
19 | .\" 4. Neither the name of the University nor the names of its contributors | |
20 | .\" may be used to endorse or promote products derived from this software | |
21 | .\" without specific prior written permission. | |
22 | .\" | |
23 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
24 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
25 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
26 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
27 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
28 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
29 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
30 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
31 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
33 | .\" SUCH DAMAGE. | |
34 | .\" | |
35 | .\" @(#)quotactl.2 6.13 (Berkeley) 7/23/91 | |
36 | .\" | |
37 | .Dd July 23, 1991 | |
38 | .Dt QUOTACTL 2 | |
39 | .Os | |
40 | .Sh NAME | |
41 | .Nm quotactl | |
42 | .Nd manipulate filesystem quotas | |
43 | .Sh SYNOPSIS | |
44 | .Ft #include <ufs/quota.h> /* for ufs quotas */ | |
45 | .Ft int | |
46 | .Fn quotactl "const char *path" "int cmd" "int id" "char *addr" | |
47 | .Sh DESCRIPTION | |
48 | The | |
49 | .Fn quotactl | |
50 | call enables, disables and | |
51 | manipulates filesystem quotas. | |
52 | A quota control command | |
53 | given by | |
54 | .Fa cmd | |
55 | operates on the given filename | |
56 | .Fa path | |
57 | for the given user | |
58 | .Fa id . | |
59 | The address of an optional command specific data structure, | |
60 | .Fa addr , | |
61 | may be given; its interpretation | |
62 | is discussed below with each command. | |
63 | .Pp | |
64 | Currently quotas are supported only for the ``ufs'' filesystem. | |
65 | For ``ufs'', | |
66 | a command is composed of a primary command (see below) | |
67 | and a command type used to interpret the | |
68 | .Fa id . | |
69 | Types are supported for interpretation of user identifiers | |
70 | and group identifiers. | |
71 | The ``ufs'' specific commands are: | |
72 | .Bl -tag -width Q_QUOTAON | |
73 | .It Dv Q_QUOTAON | |
74 | Enable disk quotas for the filesystem specified by | |
75 | .Fa path . | |
76 | The command type specifies the type of the quotas being enabled. | |
77 | The | |
78 | .Fa addr | |
79 | argument specifies a file from which to take the quotas. | |
80 | The quota file must exist; | |
81 | it is normally created with the | |
82 | .Xr quotacheck 8 | |
83 | program. | |
84 | The | |
85 | .Fa id | |
86 | argument is unused. | |
87 | Only the super-user may turn quotas on. | |
88 | .It Dv Q_QUOTAOFF | |
89 | Disable disk quotas for the filesystem specified by | |
90 | .Fa path . | |
91 | The command type specifies the type of the quotas being disabled. | |
92 | The | |
93 | .Fa addr | |
94 | and | |
95 | .Fa id | |
96 | arguments are unused. | |
97 | Only the super-user may turn quotas off. | |
98 | .It Dv Q_GETQUOTA | |
99 | Get disk quota limits and current usage for the user or group | |
100 | (as determined by the command type) with identifier | |
101 | .Fa id . | |
102 | .Fa Addr | |
103 | is a pointer to a | |
104 | .Fa struct dqblk | |
105 | structure (defined in | |
106 | .Ao Pa ufs/quota.h Ac ) . | |
107 | .It Dv Q_SETQUOTA | |
108 | Set disk quota limits for the user or group | |
109 | (as determined by the command type) with identifier | |
110 | .Fa id . | |
111 | .Fa Addr | |
112 | is a pointer to a | |
113 | .Fa struct dqblk | |
114 | structure (defined in | |
115 | .Ao Pa ufs/quota.h Ac ) . | |
116 | The usage fields of the | |
117 | .Fa dqblk | |
118 | structure are ignored. | |
119 | This call is restricted to the super-user. | |
120 | .It Dv Q_SETUSE | |
121 | Set disk usage limits for the user or group | |
122 | (as determined by the command type) with identifier | |
123 | .Fa id . | |
124 | .Fa Addr | |
125 | is a pointer to a | |
126 | .Fa struct dqblk | |
127 | structure (defined in | |
128 | .Ao Pa ufs/quota.h Ac ) . | |
129 | Only the usage fields are used. | |
130 | This call is restricted to the super-user. | |
131 | .It Dv Q_SYNC | |
132 | Update the on-disk copy of quota usages. | |
133 | The command type specifies which type of quotas are to be updated. | |
134 | The | |
135 | .Fa id | |
136 | and | |
137 | .Fa addr | |
138 | parameters are ignored. | |
139 | .El | |
140 | .Sh RETURN VALUES | |
141 | A successful call returns 0, | |
142 | otherwise the value -1 is returned and the global variable | |
143 | .Va errno | |
144 | indicates the reason for the failure. | |
145 | .Sh ERRORS | |
146 | A | |
147 | .Fn quotactl | |
148 | call will fail if: | |
149 | .Bl -tag -width ENAMETOOLONGAA | |
150 | .It Bq Er EOPNOTSUPP | |
151 | The kernel has not been compiled with the | |
152 | .Dv QUOTA | |
153 | option. | |
154 | .It Bq Er EUSERS | |
155 | The quota table cannot be expanded. | |
156 | .It Bq Er EINVAL | |
157 | .Fa Cmd | |
158 | or the command type is invalid. | |
159 | .It Bq Er EINVAL | |
160 | A pathname contains a character with the high-order bit set. | |
161 | .It Bq Er EACCES | |
162 | In | |
163 | .Dv Q_QUOTAON , | |
164 | the quota file is not a plain file. | |
165 | .It Bq Er EACCES | |
166 | Search permission is denied for a component of a path prefix. | |
167 | .It Bq Er ENOTDIR | |
168 | A component of a path prefix was not a directory. | |
169 | .It Bq Er ENAMETOOLONG | |
170 | A component of either pathname exceeded 255 characters, | |
171 | or the entire length of either path name exceeded 1023 characters. | |
172 | .It Bq Er ENOENT | |
173 | A filename does not exist. | |
174 | .It Bq Er ELOOP | |
175 | Too many symbolic links were encountered in translating a pathname. | |
176 | .It Bq Er EROFS | |
177 | In | |
178 | .Dv Q_QUOTAON , | |
179 | the quota file resides on a read-only filesystem. | |
180 | .It Bq Er EIO | |
181 | An | |
182 | .Tn I/O | |
183 | error occurred while reading from or writing | |
184 | to a file containing quotas. | |
185 | .It Bq Er EFAULT | |
186 | An invalid | |
187 | .Fa addr | |
188 | was supplied; the associated structure could not be copied in or out | |
189 | of the kernel. | |
190 | .It Bq Er EFAULT | |
191 | .Fa Path | |
192 | points outside the process's allocated address space. | |
193 | .It Bq Er EPERM | |
194 | The call was privileged and the caller was not the super-user. | |
195 | .El | |
196 | .Sh SEE ALSO | |
197 | .Xr quota 1 , | |
198 | .Xr fstab 5 , | |
199 | .Xr edquota 8 , | |
200 | .Xr quotacheck 8 , | |
201 | .Xr quotaon 8 , | |
202 | .Xr repquota 8 | |
203 | .Sh BUGS | |
204 | There should be some way to integrate this call with the resource | |
205 | limit interface provided by | |
206 | .Xr setrlimit 2 | |
207 | and | |
208 | .Xr getrlimit 2 . | |
209 | .Sh HISTORY | |
210 | The | |
211 | .Nm quotactl | |
212 | function call appeared in | |
213 | .Bx 4.3 Reno . |