QUOTACTL(2)

NAME
quotactl - manipulate disk quotas

SYNOPSIS
#include <ufs/quota.h>

quotactl(cmd, special, uid, addr)
int cmd;
char *special;
int uid;
caddr_t addr;

DESCRIPTION

The quotactl call manipulates disk quotas. The cmd parameter indicates a command to be applied to the user ID uid. Special is a pointer to a null-terminated string containing the pathname of the block special device for the filesystem being manipulated. The block special device must be mounted. Addr is the address of an optional, command-specific, data structure that is copied in or out of the system. The interpretation of addr is given with each command below.

Q_QUOTAON
    Turn on quotas for a filesystem. Addr is a pointer to a null-terminated string containing the pathname of the file containing the quotas for the filesystem. The quota file must exist and the commands for the quota system require that it be named quotas . This call is restricted to the super-user.

Q_QUOTAOFF
    Turn off quotas for a filesystem. This call is restricted to the super-user.

Q_GETQUOTA
    Get disk quota limits and current usage for user uid. Addr is a pointer to a struct dqblk structure (defined in <ufs/quota.h>). Only the super-user may get the quotas of some other user.

Q_SETQUOTA
    Set disk quota limits and current usage for user uid. Addr is a pointer to a struct dqblk structure (defined in <ufs/quota.h>). This call is restricted to the super-user.

Q_SETQLIM
    Set disk quota limits for user uid. Addr is a pointer to a struct dqblk structure (defined in <ufs/quota.h>). This call is restricted to the super-user.

Q_SYNC
    Update the on-disk copy of quota usages. This call is restricted to the super-user.

RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error.

ERRORS
A quotactl call will fail when one of the following occurs:

EINVAL
    Cmd is invalid.

EPERM
    The call is privileged and the caller was not the super-user.

EINVAL
    The special parameter is not a mounted filesystem or is a mounted filesystem without quotas enabled.

ENOTBLK
    The special parameter is not a block device.

EFAULT
    An invalid addr is supplied; the associated structure could not be copied in or out of the kernel.

EINVAL
    The addr parameter is being interpreted as the path of a quota file that exists but is not a regular file or is not on the filesystem pointed to by the special parameter.

EUSERS
    The quota table is full.

SEE ALSO
quotaon(8), quotacheck(8)

BUGS
There should be some way to integrate this call with the resource limit interface provided by setrlimit(2) and getrlimit(2). Incompatible with Melbourne quotas.