quotactl - manipulate disk quotas
char *special;
The quotactl() call manipulates disk quotas. cmd indicates a command to be applied to UID id or GID id. To set the type of quota use the QCMD(cmd,type) macro. special is a pointer to a nullterminated string containing the path name of the block special device for the file system being manipulated. addr is the address of an optional, command specific, data structure which is copied in or out of the system. The interpretation of addr is given with each command below.
|
Q_QUOTAON Q_QUOTAOFF Q_GETQUOTA Q_SETQUOTA Q_SETQLIM Q_SYNC |
Turn on quotas for a file system. addr 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 quotacheck(8) program. This call is restricted to the superuser. Turn off quotas for a file system. addr and uid are ignored. This call is restricted to the superuser. Get disk quota limits and current usage for user or group id. addr is a pointer to a dqblk structure (defined in <linux/quota.h>). Only the superuser may get the quotas of a user other than himself. Set disk quota limits and current usage for user or group id. addr is a pointer to a dqblk structure (defined in <linux/quota.h>). This call is restricted to the superuser. Set disk quota limits for user or group id. addr is a pointer to a dqblk structure (defined in <linux/quota.h>). This call is restricted to the superuser. Update the ondisk copy of quota usages for a file system. If special is null then all file systems with active quotas are sync'ed. addr and uid are ignored. |
|
quotactl() returns: |
|||
|
0 -1 |
on success. on failure and sets errno to indicate the error. |
|
EFAULT EINVAL ENOENT ENOTBLK EPERM ESRCH EUSERS |
addr or special are invalid. The kernel has not been compiled with the QUOTA option. cmd is invalid. The file specified by special or addr does not exist. special is not a block device. The call is privileged and the caller was not the superuser. No disc quota is found for the indicated user. Quotas have not been turned on for this file system. The quota table is full. |
If cmd is Q_QUOTAON, quotactl() may set errno to:
EACCES The quota file pointed to by addr exists but is not a regular file.
|
The quota file pointed to by addr exists but is not on the file system pointed to by special. |
|
EBUSY |
quota(1), getrlimit(2), quotacheck(8), quotaon(8)