2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
|
|
|
.\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
2006-03-02 04:12:55 +00:00
|
|
|
.\" FIXME There is much that is missing and/or out of date in this page.
|
|
|
|
.\" As things stand the page more or less documents Linux 2.2 reality:
|
|
|
|
.\"
|
|
|
|
.\" Linux 2.2 has:
|
|
|
|
.\"
|
|
|
|
.\" Q_GETQUOTA
|
|
|
|
.\" Q_GETSTATS
|
|
|
|
.\" Q_QUOTAOFF
|
|
|
|
.\" Q_QUOTAON
|
|
|
|
.\" Q_RSQUASH (not currently documented)
|
|
|
|
.\" Q_SETQLIM
|
|
|
|
.\" Q_SETQUOTA
|
|
|
|
.\" Q_SETUSE
|
|
|
|
.\" Q_SYNC
|
|
|
|
.\"
|
|
|
|
.\" Linux 2.4 has:
|
2007-06-21 22:55:04 +00:00
|
|
|
.\"
|
2006-03-02 04:12:55 +00:00
|
|
|
.\" Q_COMP_QUOTAOFF
|
|
|
|
.\" Q_COMP_QUOTAON
|
|
|
|
.\" Q_COMP_SYNC
|
|
|
|
.\" Q_GETFMT
|
|
|
|
.\" Q_GETINFO
|
|
|
|
.\" Q_GETQUOTA
|
|
|
|
.\" Q_QUOTAOFF
|
|
|
|
.\" Q_QUOTAON
|
|
|
|
.\" Q_SETINFO
|
|
|
|
.\" Q_SETQUOTA
|
|
|
|
.\" Q_SYNC
|
2007-04-12 22:42:49 +00:00
|
|
|
.\" Q_V1_GETQUOTA Q_V1_GETSTATS Q_V1_RSQUASH Q_V1_SETQLIM
|
2006-03-02 04:12:55 +00:00
|
|
|
.\" Q_V1_SETQUOTA Q_V1_SETUSE
|
2007-04-12 22:42:49 +00:00
|
|
|
.\" Q_V2_GETINFO Q_V2_GETQUOTA Q_V2_SETFLAGS Q_V2_SETGRACE
|
2006-03-02 04:12:55 +00:00
|
|
|
.\" Q_V2_SETINFO Q_V2_SETQUOTA Q_V2_SETUSE
|
2007-04-12 22:42:49 +00:00
|
|
|
.\" Q_XGETQSTAT Q_XGETQUOTA Q_XQUOTAOFF Q_XQUOTAON Q_XQUOTARM
|
2006-03-02 04:12:55 +00:00
|
|
|
.\" Q_XSETQLIM
|
|
|
|
.\"
|
|
|
|
.\" Linux 2.6.16 has:
|
|
|
|
.\"
|
|
|
|
.\" Q_GETFMT
|
|
|
|
.\" Q_GETINFO
|
|
|
|
.\" Q_GETQUOTA
|
|
|
|
.\" Q_QUOTAOFF
|
|
|
|
.\" Q_QUOTAON
|
|
|
|
.\" Q_SETINFO
|
|
|
|
.\" Q_SETQUOTA
|
|
|
|
.\" Q_SYNC
|
|
|
|
.\" Q_XGETQSTAT
|
|
|
|
.\" Q_XGETQUOTA
|
|
|
|
.\" Q_XQUOTAOFF
|
|
|
|
.\" Q_XQUOTAON
|
|
|
|
.\" Q_XQUOTARM
|
|
|
|
.\" Q_XQUOTASYNC
|
|
|
|
.\" Q_XSETQLIM
|
|
|
|
.\"
|
2007-05-30 05:36:26 +00:00
|
|
|
.TH QUOTACTL 2 2007-06-01 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
quotactl \- manipulate disk quota
|
|
|
|
.SH SYNOPSIS
|
2006-03-16 00:28:09 +00:00
|
|
|
.nf
|
2004-11-03 13:51:07 +00:00
|
|
|
.B #include <sys/types.h>
|
|
|
|
.br
|
|
|
|
.B #include <sys/quota.h>
|
|
|
|
.sp
|
2006-03-16 00:28:09 +00:00
|
|
|
.BI "int quotactl(int " cmd ", const char *" special ", int " id \
|
|
|
|
", caddr_t " addr );
|
|
|
|
.fi
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
The quota system defines for each user and/or group a soft limit
|
|
|
|
and a hard limit bounding the amount of disk space that can be
|
2007-04-12 22:42:49 +00:00
|
|
|
used on a given file system.
|
|
|
|
The hard limit cannot be crossed.
|
|
|
|
The soft limit can be crossed, but warnings will ensue.
|
|
|
|
Moreover,
|
2004-11-03 13:51:07 +00:00
|
|
|
the user cannot be above the soft limit for more than one week (by default)
|
|
|
|
at a time: after this week the soft limit counts as hard limit.
|
|
|
|
|
|
|
|
The
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR quotactl ()
|
2007-04-12 22:42:49 +00:00
|
|
|
system call manipulates these quota.
|
|
|
|
Its first argument is
|
2004-11-03 13:51:07 +00:00
|
|
|
of the form
|
|
|
|
.BI QCMD( subcmd , type )
|
|
|
|
where
|
|
|
|
.I type
|
|
|
|
is either
|
|
|
|
.B USRQUOTA
|
|
|
|
or
|
|
|
|
.B GRPQUOTA
|
|
|
|
(for user quota and group quota, respectively), and
|
|
|
|
.I subcmd
|
|
|
|
is described below.
|
|
|
|
|
|
|
|
The second argument
|
|
|
|
.I special
|
|
|
|
is the block special device these quota apply to.
|
|
|
|
It must be mounted.
|
|
|
|
|
|
|
|
The third argument
|
|
|
|
.I id
|
|
|
|
is the user or group ID these quota apply to (when relevant).
|
|
|
|
|
|
|
|
The fourth argument
|
|
|
|
.I addr
|
|
|
|
is the address of a data structure, depending on the command.
|
|
|
|
|
|
|
|
The
|
|
|
|
.I subcmd
|
|
|
|
is one of
|
|
|
|
.TP 1.1i
|
|
|
|
.B Q_QUOTAON
|
2007-04-12 22:42:49 +00:00
|
|
|
Enable quota.
|
|
|
|
The
|
2004-11-03 13:51:07 +00:00
|
|
|
.I addr
|
|
|
|
argument is the pathname of the file containing
|
|
|
|
the quota for the filesystem.
|
|
|
|
.TP
|
|
|
|
.B Q_QUOTAOFF
|
|
|
|
Disable quota.
|
|
|
|
.TP
|
|
|
|
.B Q_GETQUOTA
|
2007-04-12 22:42:49 +00:00
|
|
|
Get limits and current usage of disk space.
|
|
|
|
The
|
2004-11-03 13:51:07 +00:00
|
|
|
.I addr
|
|
|
|
argument is a pointer to a dqblk structure (defined in
|
|
|
|
.IR <sys/quota.h> ).
|
|
|
|
.TP
|
|
|
|
.B Q_SETQUOTA
|
|
|
|
Set limits and current usage;
|
|
|
|
.I addr
|
|
|
|
is as before.
|
|
|
|
.TP
|
|
|
|
.B Q_SETQLIM
|
|
|
|
Set limits;
|
|
|
|
.I addr
|
|
|
|
is as before.
|
|
|
|
.TP
|
|
|
|
.B Q_SETUSE
|
|
|
|
Set usage.
|
|
|
|
.TP
|
|
|
|
.B Q_SYNC
|
|
|
|
Sync disk copy of a filesystem's quota.
|
|
|
|
.TP
|
|
|
|
.B Q_GETSTATS
|
|
|
|
Get collected stats.
|
|
|
|
.SH "RETURN VALUE"
|
|
|
|
On success,
|
2005-10-19 06:54:38 +00:00
|
|
|
.BR quotactl ()
|
2007-04-12 22:42:49 +00:00
|
|
|
returns 0.
|
|
|
|
On error, \-1 is returned, and
|
2004-11-03 13:51:07 +00:00
|
|
|
.I errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
.TP 0.9i
|
|
|
|
.B EACCES
|
|
|
|
The quota file is not an ordinary file.
|
|
|
|
.TP
|
|
|
|
.B EBUSY
|
|
|
|
.B Q_QUOTAON
|
2006-03-02 04:12:55 +00:00
|
|
|
was asked, but quotas were enabled already.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
|
|
|
.B EFAULT
|
|
|
|
Bad
|
|
|
|
.I addr
|
|
|
|
value.
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
|
|
|
.I type
|
2007-04-12 22:42:49 +00:00
|
|
|
is not a known quota type.
|
|
|
|
Or,
|
2004-11-03 13:51:07 +00:00
|
|
|
.I special
|
|
|
|
could not be found.
|
|
|
|
.TP
|
|
|
|
.B EIO
|
|
|
|
Cannot read or write the quota file.
|
|
|
|
.TP
|
|
|
|
.B EMFILE
|
|
|
|
Too many open files: cannot open quota file.
|
|
|
|
.TP
|
|
|
|
.B ENODEV
|
|
|
|
.I special
|
|
|
|
cannot be found in the mount table.
|
|
|
|
.TP
|
|
|
|
.B ENOPKG
|
|
|
|
The kernel was compiled without quota support.
|
|
|
|
.TP
|
|
|
|
.B ENOTBLK
|
|
|
|
.I special
|
|
|
|
is not a block special device.
|
|
|
|
.TP
|
|
|
|
.B EPERM
|
|
|
|
The process was not root (for the file system), and
|
|
|
|
.B Q_GETQUOTA
|
|
|
|
was asked for another
|
|
|
|
.I id
|
|
|
|
than that of the process itself, or anything other than
|
|
|
|
.B Q_GETSTATS
|
|
|
|
or
|
|
|
|
.B Q_SYNC
|
|
|
|
was asked.
|
|
|
|
.TP
|
|
|
|
.B ESRCH
|
|
|
|
.B Q_GETQUOTA
|
|
|
|
or
|
|
|
|
.B Q_SETQUOTA
|
|
|
|
or
|
|
|
|
.B Q_SETUSE
|
|
|
|
or
|
|
|
|
.B Q_SETQLIM
|
|
|
|
was asked for a file system that didn't have quota enabled.
|
|
|
|
.SH "CONFORMING TO"
|
|
|
|
BSD
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR quota (1),
|
|
|
|
.BR getrlimit (2),
|
|
|
|
.BR setrlimit (2),
|
|
|
|
.BR ulimit (3),
|
|
|
|
.BR quotacheck (8),
|
|
|
|
.BR quotaon (8)
|