Commit | Line | Data |
---|---|---|
de49f60d | 1 | .\" Copyright (c) 1983, 1990 Regents of the University of California. |
f9ac90b4 | 2 | .\" All rights reserved. |
02b31b1d | 3 | .\" |
de49f60d KM |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" Robert Elz at The University of Melbourne. | |
6 | .\" | |
f9ac90b4 | 7 | .\" Redistribution and use in source and binary forms are permitted |
57a981eb KB |
8 | .\" provided that the above copyright notice and this paragraph are |
9 | .\" duplicated in all such forms and that any documentation, | |
10 | .\" advertising materials, and other materials related to such | |
11 | .\" distribution and use acknowledge that the software was developed | |
12 | .\" by the University of California, Berkeley. The name of the | |
13 | .\" University may not be used to endorse or promote products derived | |
14 | .\" from this software without specific prior written permission. | |
15 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
16 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
17 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
f9ac90b4 | 18 | .\" |
de49f60d | 19 | .\" @(#)quotactl.2 6.10 (Berkeley) %G% |
02b31b1d | 20 | .\" |
de49f60d KM |
21 | .TH QUOTACTL 2 "" |
22 | .UC 7 | |
02b31b1d | 23 | .SH NAME |
de49f60d | 24 | quotactl \- manipulate disk quotas |
02b31b1d | 25 | .SH SYNOPSIS |
de49f60d | 26 | .BI "#include <ufs/quota.h>" " /* for ``ufs'' quotas */" |
02b31b1d | 27 | .PP |
de49f60d KM |
28 | .nf |
29 | .B quotactl(path, cmd, id, addr) | |
30 | .B char *path; | |
31 | .B int cmd, id; | |
f37273f0 | 32 | .B char *addr; |
02b31b1d KM |
33 | .fi |
34 | .SH DESCRIPTION | |
35 | The | |
de49f60d KM |
36 | .I quotactl |
37 | call is used to enable and disable quotas and | |
38 | to manipulate disk quotas for filesystems on | |
39 | which quotas have been enabled. | |
40 | .I Path | |
41 | is the path name of any file within the mounted filesystem | |
42 | to which the quota control command is to be applied. | |
02b31b1d KM |
43 | The |
44 | .I cmd | |
de49f60d KM |
45 | parameter indicates a command to be applied to the |
46 | .IR id . | |
47 | .I Addr | |
02b31b1d | 48 | is the address of an optional, command specific, data structure |
3096bc80 | 49 | that is copied in or out of the system. The interpretation of |
02b31b1d | 50 | .I addr |
de49f60d KM |
51 | is given with each command. |
52 | .PP | |
53 | Currently quotas are supported only for the ``ufs'' filesystem. | |
54 | For ``ufs'', | |
55 | a command is composed of a primary command (see below) | |
56 | and a command type that is used to interpret the | |
57 | .IR id . | |
58 | Types are supported for interpretation of user identifiers | |
59 | and group identifiers. | |
60 | The ``ufs'' specific commands are: | |
61 | .TP | |
62 | Q_QUOTAON | |
63 | Enable disk quotas for the filesystem specified by | |
64 | .IR path . | |
65 | The command type specifies the type of the quotas being enabled. | |
66 | The | |
67 | .I addr | |
68 | argument specifies a file from which to take the quotas. | |
69 | The quota file must exist; | |
70 | it is normally created with the | |
71 | .IR quotacheck (8) | |
72 | program. | |
73 | The | |
74 | .I id | |
75 | argument is unused. | |
76 | Only the super-user may turn quotas on. | |
02b31b1d | 77 | .TP |
de49f60d KM |
78 | Q_QUOTAOFF |
79 | Disable disk quotas for the filesystem specified by | |
80 | .I path . | |
81 | The command type specifies the type of the quotas being disabled. | |
82 | The | |
83 | .I addr | |
84 | and | |
85 | .I id | |
86 | arguments are unused. | |
87 | Only the super-user may turn quotas off. | |
88 | .TP | |
89 | Q_GETQUOTA | |
90 | Get disk quota limits and current usage for the user or group | |
91 | (as determined by the command type) with identifier | |
92 | .IR id . | |
02b31b1d KM |
93 | .I Addr |
94 | is a pointer to a struct dqblk structure (defined in | |
de49f60d | 95 | .RI < ufs/quota.h >). |
02b31b1d | 96 | .TP |
de49f60d KM |
97 | Q_SETQUOTA |
98 | Set disk quota limits for the user or group | |
99 | (as determined by the command type) with identifier | |
100 | .IR id . | |
02b31b1d | 101 | .I Addr |
de49f60d KM |
102 | is a pointer to a struct dqblk structure (defined in |
103 | .RI < ufs/quota.h >). | |
104 | The usage fields of the dqblk structure are ignored. | |
02b31b1d KM |
105 | This call is restricted to the super-user. |
106 | .TP | |
de49f60d KM |
107 | Q_SETUSE |
108 | Set disk usage limits for the user or group | |
109 | (as determined by the command type) with identifier | |
110 | .IR id . | |
02b31b1d | 111 | .I Addr |
de49f60d KM |
112 | is a pointer to a struct dqblk structure (defined in |
113 | .RI < ufs/quota.h >). | |
114 | Only the usage fields are used. | |
02b31b1d KM |
115 | This call is restricted to the super-user. |
116 | .TP | |
de49f60d KM |
117 | Q_SYNC |
118 | Update the on-disk copy of quota usages. | |
119 | The command type specifies which type of quotas are to be updated. | |
120 | The \fIid\fP and \fIaddr\fP parameters are ignored. | |
02b31b1d | 121 | .SH "RETURN VALUE" |
47fbd25c KM |
122 | A successful call returns 0, |
123 | otherwise the value \-1 is returned and the global variable | |
02b31b1d | 124 | .I errno |
47fbd25c | 125 | indicates the reason for the failure. |
02b31b1d | 126 | .SH ERRORS |
de49f60d | 127 | A \fIquotactl\fP call will fail when one of the following occurs: |
47fbd25c | 128 | .TP 15 |
de49f60d | 129 | [EOPNOTSUPP] |
47fbd25c | 130 | The kernel has not been compiled with the QUOTA option. |
02b31b1d | 131 | .TP 15 |
de49f60d KM |
132 | [EUSERS] |
133 | The quota table cannot be expanded. | |
134 | .TP 15 | |
02b31b1d KM |
135 | [EINVAL] |
136 | .I Cmd | |
de49f60d | 137 | or the command type is invalid. |
02b31b1d | 138 | .TP 15 |
de49f60d KM |
139 | [EINVAL] |
140 | A pathname contains a character with the high-order bit set. | |
02b31b1d | 141 | .TP 15 |
de49f60d KM |
142 | [EACCES] |
143 | In Q_QUOTAON, the quota file is not a plain file. | |
144 | .TP 15 | |
145 | [EACCES] | |
146 | Search permission is denied for a component of a path prefix. | |
02b31b1d | 147 | .TP 15 |
de49f60d KM |
148 | [ENOTDIR] |
149 | A component of a path prefix is not a directory. | |
150 | .TP 15 | |
151 | [ENAMETOOLONG] | |
152 | A component of either pathname exceeded 255 characters, | |
153 | or the entire length of either path name exceeded 1023 characters. | |
154 | .TP 15 | |
155 | [ENOENT] | |
156 | A filename does not exist. | |
157 | .TP 15 | |
158 | [ELOOP] | |
159 | Too many symbolic links were encountered in translating a pathname. | |
160 | .TP 15 | |
161 | [EROFS] | |
162 | In Q_QUOTAON, the quota file resides on a read-only filesystem. | |
163 | .TP 15 | |
164 | [EIO] | |
165 | An I/O error occurred while reading from or writing | |
166 | to a file containing quotas. | |
02b31b1d KM |
167 | .TP 15 |
168 | [EFAULT] | |
169 | An invalid | |
170 | .I addr | |
171 | is supplied; the associated structure could not be copied in or out | |
172 | of the kernel. | |
173 | .TP 15 | |
de49f60d KM |
174 | [EFAULT] |
175 | .I Path | |
176 | points outside the process's allocated address space. | |
177 | .TP 15 | |
178 | [EPERM] | |
179 | The call is privileged and the caller was not the super-user. | |
02b31b1d | 180 | .SH "SEE ALSO" |
de49f60d KM |
181 | quota(1), |
182 | fstab(5), | |
183 | edquota(8), quotacheck(8), quotaon(8), repquota(8) | |
02b31b1d | 184 | .SH BUGS |
09cfce6f | 185 | There should be some way to integrate this call with the resource |
02b31b1d KM |
186 | limit interface provided by |
187 | .IR setrlimit (2) | |
188 | and | |
189 | .IR getrlimit (2). |