2 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH QUOTACTL 7I "Jun 14, 2004"
8 quotactl \- manipulate disk quotas
12 #include <sys/fs/ufs_quota.h>
13 int ioctl(int \fIfd\fR, Q_QUOTACTL, struct quotcl *\fIqp\fR)
19 This \fBioctl()\fR call manipulates disk quotas. \fIfd\fR is the file
20 descriptor returned by the \fBopen()\fR system call after opening the
21 \fBquotas\fR file (located in the root directory of the filesystem running
22 quotas.) \fBQ_QUOTACTL\fR is defined in \fB/usr/include/sys/fs/ufs_quota.h\fR.
23 \fIqp\fR is the address of the \fBquotctl\fR structure which is defined as
37 \fIop\fR indicates an operation to be applied to the user \fBID\fR \fIuid\fR.
38 (See below.) \fIaddr\fR is the address of an optional, command specific, data
39 structure which is copied in or out of the system. The interpretation of
40 \fIaddr\fR is given with each value of \fIop\fR below.
47 Turn on quotas for a file system. \fIaddr\fR points to the full pathname of the
48 \fBquotas\fR file. \fIuid\fR is ignored. It is recommended that \fIuid\fR have
49 the value of \fB0\fR. This call is restricted to the super-user.
55 \fB\fBQ_QUOTAOFF\fR\fR
58 Turn off quotas for a file system. \fIaddr\fR and \fIuid\fR are ignored. It is
59 recommended that \fIaddr\fR have the value of \fINULL\fR and \fIuid\fR have the
60 value of \fB0\fR. This call is restricted to the super-user.
66 \fB\fBQ_GETQUOTA\fR\fR
69 Get disk quota limits and current usage for user \fIuid\fR. \fIaddr\fR is a
70 pointer to a \fBdqblk\fR structure (defined in \fB<sys/fs/ufs_quota.h>\fR).
71 Only the super-user may get the quotas of a user other than himself.
77 \fB\fBQ_SETQUOTA\fR\fR
80 Set disk quota limits and current usage for user \fIuid\fR. \fIaddr\fR is a
81 pointer to a \fBdqblk\fR structure (defined in \fBsys/fs/ufs_quota.h\fR). This
82 call is restricted to the super-user.
91 Set disk quota limits for user \fIuid\fR. \fIaddr\fR is a pointer to a
92 \fBdqblk\fR structure (defined in \fBsys/fs/ufs_quota.h\fR). This call is
93 restricted to the super-user.
102 Update the on-disk copy of quota usages for this file system. \fIaddr\fR and
103 \fIuid\fR are ignored.
109 \fB\fBQ_ALLSYNC\fR\fR
112 Update the on-disk copy of quota usages for all file systems with active
113 quotas. \fIaddr\fR and \fIuid\fR are ignored.
119 This \fBioctl()\fR returns:
135 on failure and sets \fBerrno\fR to indicate the error.
145 \fIaddr\fR is invalid.
154 The kernel has not been compiled with the \fBQUOTA\fR option. \fIop\fR is
164 The \fBquotas\fR file specified by \fIaddr\fR does not exist.
173 The call is privileged and the calling process did not assert
174 {PRIV_SYS_MOUNT} in the effective set.
183 No disk quota is found for the indicated user. Quotas have not been turned on
184 for this file system.
193 The quota table is full.
198 If \fIop\fR is \fBQ_QUOTAON\fR, \fBioctl()\fR may set \fBerrno\fR to:
205 The quota file pointed to by \fIaddr\fR exists but is not a regular file. The
206 quota file pointed to by \fIaddr\fR exists but is not on the file system
207 pointed to by \fIspecial\fR.
216 Internal I/O error while attempting to read the \fBquotas\fR file pointed to by
224 \fB\fB/usr/include/sys/fs/ufs_quota.h\fR\fR
228 quota-related structure/function definitions and defines
234 \fBquota\fR(1M), \fBquotacheck\fR(1M), \fBquotaon\fR(1M), \fBgetrlimit\fR(2),
239 There should be some way to integrate this call with the resource limit
240 interface provided by \fBsetrlimit()\fR and \fBgetrlimit\fR(2).
243 This call is incompatible with Melbourne quotas.