<html>
<head>
<meta name="Content-Style" content="text/css">
</head>
<body>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="##include <linux/quota.h>">#include <linux/quota.h></a><br>
<a href="#int quotactl(cmd, special, uid, addr)">int quotactl(cmd, special, uid, addr)</a><br>
<a href="#int cmd;">int cmd;</a><br>
<a href="#int uid;">int uid;</a><br>
<a href="#caddr_t addr;">caddr_t addr;</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#RETURN VALUES">RETURN VALUES</a><br>
<a href="#ERRORS">ERRORS</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<!-- Creator : groff version 1.16.1 -->
<!-- CreationDate: Wed Jan 24 01:42:50 2001
-->
<!-- Total number of pages: 2 -->
<!-- Page: 1 -->
<!-- left margin: 220 -->
<!-- right margin: 750 -->
<a name="NAME"></a><h2>NAME</h2><p style="margin-left: 18%"><font size=3>quotactl - manipulate disk quotas</font></p>
<a name="SYNOPSIS"></a><h2>SYNOPSIS</h2><a name="#include <linux/quota.h>"></a><h2>#include <linux/quota.h></h2><a name="int quotactl(cmd, special, uid, addr)"></a><h2>int quotactl(cmd, special, uid, addr)</h2><a name="int cmd;"></a><h2>int cmd;</h2><p style="margin-left: 18%"><font size=3><B>char</B></font> <font size=3>*</font><font size=3><B>special;<br>
</B></font></p>
<a name="int uid;"></a><h2>int uid;</h2><a name="caddr_t addr;"></a><h2>caddr_t addr;</h2><a name="DESCRIPTION"></a><h2>DESCRIPTION</h2><p style="margin-left: 18%"><font size=3>The</font> <font size=3><B>quotactl()</B></font> <font size=3>call manipulates disk quotas.</font> <font size=3><I>cmd</I></font> <font size=3>indicates a command to be applied to</font> <font size=2>UID</font> <font size=3><I>id</I></font> <font size=3>or</font> <font size=2>GID</font> <font size=3><I>id</I></font><font size=3>. To set the type of quota use the</font> <font size=3><I>QCMD(cmd,</I></font><font size=3>type) macro.</font> <font size=3><I>special</I></font> <font size=3>is a pointer to a null­terminated string containing the path name of the block special device for the file system being manipulated.</font> <font size=3><I>addr</I></font> <font size=3>is the address of an optional, command specific, data structure which is copied in or out of the system. The interpretation of</font> <font size=3><I>addr</I></font> <font size=3>is given with each command below.</font>
<table width="98%" rules="none" frame="none" cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</p>
</td>
<td valign="top" align="left" width="13%">
<p><font size=2><B>Q_QUOTAON</B></font></p>
<p><font size=2><B>Q_QUOTAOFF</B></font></p>
<p><font size=2><B>Q_GETQUOTA Q_SETQUOTA</B></font></p>
<p><font size=2><B>Q_SETQLIM</B></font></p>
<p><font size=2><B>Q_SYNC</B></font></p>
</td>
<td valign="top" align="left" width="67%">
<p><font size=3>Turn on quotas for a file system.</font> <font size=3><I>addr</I></font> <font size=3>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</font> <font size=3><B>quotacheck</B></font><font size=3>(8) program. This call is restricted to the super­user.</font></p>
<p><font size=3>Turn off quotas for a file system.</font> <font size=3><I>addr</I></font> <font size=3>and</font> <font size=3><I>uid</I></font> <font size=3>are ignored. This call is restricted to the super­user.</font></p>
<p><font size=3>Get disk quota limits and current usage for user or group</font> <font size=3><I>id</I></font><font size=3>.</font> <font size=3><I>addr</I></font> <font size=3>is a pointer to a</font> <font size=3><B>dqblk</B></font> <font size=3>structure (defined in</font> <font size=3><B><linux/quota.h></B></font><font size=3>). Only the super­user may get the quotas of a user other than himself.</font></p>
<p><font size=3>Set disk quota limits and current usage for user or group</font> <font size=3><I>id</I></font><font size=3>.</font> <font size=3><I>addr</I></font> <font size=3>is a pointer to a</font> <font size=3><B>dqblk</B></font> <font size=3>structure (defined in</font> <font size=3><B><linux/quota.h></B></font><font size=3>). This call is restricted to the super­user.</font></p>
<p><font size=3>Set disk quota limits for user or group</font> <font size=3><I>id</I></font><font size=3>.</font> <font size=3><I>addr</I></font> <font size=3>is a pointer to a</font> <font size=3><B>dqblk</B></font> <font size=3>structure (defined in</font> <font size=3><B><linux/quota.h></B></font><font size=3>). This call is restricted to the super­user.</font></p>
<p><font size=3>Update the on­disk copy of quota usages for a file system. If</font> <font size=3><I>special</I></font> <font size=3>is null then all file systems with active quotas are sync'ed.</font> <font size=3><I>addr</I></font> <font size=3>and</font> <font size=3><I>uid</I></font> <font size=3>are ignored.</font></p>
</td>
</tr>
</table>
</p>
<a name="RETURN VALUES"></a><h2>RETURN VALUES</h2>
<table width="98%" rules="none" frame="none" cols="4" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="16%">
<p><font size=3><B>quotactl()</B></font> <font size=3>returns:</font></p>
</td>
<td valign="top" align="left" width="1%">
</td>
<td valign="top" align="left" width="63%">
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="16%">
<p><font size=3>0</font></p>
<p><font size=3>-1</font></p>
</td>
<td valign="top" align="left" width="1%">
</td>
<td valign="top" align="left" width="63%">
<p><font size=3>on success.</font></p>
<p><font size=3>on failure and sets</font> <font size=3><B>errno</B></font> <font size=3>to indicate the error.</font></p>
</td>
</tr>
</table>
<a name="ERRORS"></a><h2>ERRORS</h2>
<table width="98%" rules="none" frame="none" cols="5" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="8%">
<p><font size=2>EFAULT</font></p>
<p><font size=2>EINVAL</font></p>
<p><font size=2>ENOENT</font></p>
<p><font size=2>ENOTBLK EPERM</font></p>
<p><font size=2>ESRCH</font></p>
<p><font size=2>EUSERS</font></p>
</td>
<td valign="top" align="left" width="5%">
</td>
<td valign="top" align="left" width="51%">
<p><font size=3><I>addr</I></font> <font size=3>or</font> <font size=3><I>special</I></font> <font size=3>are invalid.</font></p>
<p><font size=3>The kernel has not been compiled with the</font> <font size=2><B>QUOTA</B></font> <font size=3>option.</font></p>
<p><font size=3><I>cmd</I></font> <font size=3>is invalid.</font></p>
<p><font size=3>The file specified by</font> <font size=3><I>special</I></font> <font size=3>or</font> <font size=3><I>addr</I></font> <font size=3>does not exist.</font></p>
<p><font size=3><I>special</I></font> <font size=3>is not a block device.</font></p>
<p><font size=3>The call is privileged and the caller was not the super­user.</font></p>
<p><font size=3>No disc quota is found for the indicated user.</font></p>
<p><font size=3>Quotas have not been turned on for this file system.</font></p>
<p><font size=3>The quota table is full.</font></p>
</td>
<td valign="top" align="left" width="16%">
</td>
</tr>
</table>
<p style="margin-left: 18%"><font size=3>If</font> <font size=3><I>cmd</I></font> <font size=3>is</font> <font size=2><B>Q_QUOTAON</B></font><font size=3>,</font> <font size=3><B>quotactl()</B></font> <font size=3>may set errno to:</font></p>
<p style="margin-left: 18%"><font size=2>EACCES</font> <font size=3>The quota file pointed to by</font> <font size=3><I>addr</I></font> <font size=3>exists but is not a regular file.</font>
<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="32%">
</p>
</td>
<td valign="top" align="left" width="67%">
<p><font size=3>The quota file pointed to by</font> <font size=3><I>addr</I></font> <font size=3>exists but is not on the file system pointed to by</font> <font size=3><I>special</I></font><font size=3>.</font></p>
</td>
</tr>
</table>
<br>
</p>
<!-- Page: 2 -->
<!-- left margin: 220 -->
<!-- right margin: 741 -->
<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="81%">
<p><font size=2>EBUSY</font></p>
</td>
</tr>
</table>
<a name="SEE ALSO"></a><h2>SEE ALSO</h2><p style="margin-left: 18%"><font size=3><B>quota</B></font><font size=3>(1),</font> <font size=3><B>getrlimit</B></font><font size=3>(2),</font> <font size=3><B>quotacheck</B></font><font size=3>(8),</font> <font size=3><B>quotaon</B></font><font size=3>(8)</font><br>
</p>
</body>
</html>