summaryrefslogtreecommitdiff
path: root/doc/quotactl(2).html
blob: 63dc93418c4c04a7a4281ac42f2a14028c3c9248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<HTML>
<HEAD>
<TITLE>quotactl(2) manualpage</TITLE>
<!-- OWNER_NAME="Marco van Wieringen, OpenWorld System Management" -->
<!-- OWNER_INFO="The OpenWorld Foundation, The Netherlands" -->
<LINK REV=MADE HREF="mailto:mvw@planets.elm.net">
</HEAD>
<BODY>
<H1>NAME</H1>
quotactl - manipulate disk quotas
<H1>SYNOPSIS</H1>
<B>#include &ltlinux/quota.h&gt</B>
<P>
<B>int quotactl(cmd, special, uid, addr)
<BR>
int cmd;
<BR>
char **special;
<BR>
int id;
<BR>
caddr_t addr;</B>
<H1>DESCRIPTION</H1>
The
<B>quotactl</B>
call manipulates disk quotas.
<B>cmd</B>
indicates a command to be applied to 
<B>UID id</B>
or 
<B>GID id</B>
. To set the type of quota use the
<B>QCMD(cmd, type)</B>
macro.
<P>
<B>Special</B>
is a pointer to a null-terminated string containing the path
name of the block special device for the file system being manipulated.
<P>
<B>Addr</B>
is the address of an optional, command specific, data structure
which is copied in or out of the system.  The interpretation of
<B>addr</B>
is given with each command below.
<UL>
<LI>
<B>Q_QUOTAON</B>
<BR>
Turn on quotas for a file system.
<B>addr</B>
points to the path name of file containing the quotas for the file system.
The quota file must exist; it is normally created with the
<A HREF="quotacheck(8).html">quotacheck (8)</A>
program. This call is restricted to the super-user.
<LI>
<B>Q_QUOTAOFF</B>
<BR>
Turn off quotas for a file system.
<B>addr</B>
and
<B>id</B>
are ignored.
This call is restricted to the super-user.
<LI>
<B>Q_GETQUOTA</B>
<BR>
Get disk quota limits and current usage for user or group
<B>id</B>
.
<B>Addr</B>
is a pointer to a
<B>dqblk</B>
structure (defined in
<B>&ltlinux/quota.h&gt</B>
).
Only the super-user may get the quotas of a user other than himself.
<LI>
<B>Q_SETQUOTA</B>
<BR>
Set disk quota limits and current usage for user or group
<B>id</B>
.
<B>Addr</B>
is a pointer to a
<B>dqblk</B>
structure (defined in
<B>&ltlinux/quota.h&gt</B>
).
This call is restricted to the super-user.
<LI>
<B>Q_SETQLIM</B>
<BR>
Set disk quota limits for user or group
<B>id</B>
.
<B>Addr</B>
is a pointer to a
<B>dqblk</B>
structure (defined in
<B>&ltlinux/quota.h&gt</B>
).
This call is restricted to the super-user.
<LI>
<B>Q_SYNC</B>
<BR>
Update the on-disk copy of quota usages for a file system.
If
<B>special</B>
is null then all file systems with active quotas are sync'ed.
<B>Addr</B>
and
<B>id</B>
are ignored.
</UL>
<H1>RETURN VALUES</H1>
<B>quotactl</B>
returns:
<UL>
<LI>
0 on success.
<LI>
-1 on failure and sets
<B>errno</B>
to indicate the error.
</UL>
<H1>ERRORS</H1>
<UL>
<LI>
<B>EFAULT</B>
<BR>
<B>addr</B>
or
<B>special</B>
are invalid.
<LI>
<B>EINVAL</B>
<BR>
The kernel has not been compiled with the
<B>QUOTA</B>
option or
<B>cmd</B>
is invalid.
<LI>
<B>ENOENT</B>
<BR>
The file specified by
<B>special</B>
or
<B>addr</B>
does not exist.
<LI>
<B>ENOTBLK</B>
<BR>
<B>special</B>
is not a block device.
<LI>
<B>EPERM</B>
<BR>
The call is privileged and the caller was not the super-user.
<LI>
<B>ESRCH</B>
<BR>
No disc quota is found for the indicated user.
<BR>
Quotas have not been turned on for this file system.
<LI>
<B>EUSERS</B>
<BR>
The quota table is full.
</UL>
<P>
If
<B>cmd</B>
is
<B>Q_QUOTAON quotactl</B>
may set errno to:
<UL>
<LI>
<B>EACCES</B>
<BR>
The quota file pointed to by
<B>addr</B>
exists but is not a regular file.
<LI>
<B>EBUSY</B>
<BR>
<B>Q_QUOTAON</B>
attempted while another
<B>Q_QUOTAON</B>
has already taken place.
</UL>
<H1>SEE ALSO</H1>
<A HREF="quota(1).html">quota (1)</A>,
<A HREF="quotacheck(8).html">quotacheck (8)</A>,
<A HREF="quotaon(8).html">quotaon (8)</A>,
</BODY>
</HTML>