QUOTACTL(2-BSD) RISC/os Reference Manual QUOTACTL(2-BSD)
NAME
quotactl - manipulate disk quotas
SYNOPSIS
#include <ufs/quota.h>
int quotactl(cmd, special, uid, addr)
int cmd;
char *special;
int uid;
caddrt addr;
DESCRIPTION
The quotactl() call manipulates disk quotas. cmd indicates
a command to be applied to the user ID uid. special is a
pointer to a null-terminated string containing the path name
of the block special device for the file system being mani-
pulated. The block special device must be mounted as a FFS
file system (see mount(2-BSD)). 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 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(1M) program. This call is
restricted to the super-user.
Q_QUOTAOFF Turn off quotas for a file system. addr and
uid are ignored. 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 dqblk
structure (defined in <ufs/quota.h>). Only
the super-user may get the quotas of a user
other than himself.
Q_SETQUOTA Set disk quota limits and current usage for
user uid. addr is a pointer to a 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 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 for a
file system. If special is null then all
Printed 1/15/91 Page 1
QUOTACTL(2-BSD) RISC/os Reference Manual QUOTACTL(2-BSD)
file systems with active quotas are sync'ed.
addr and uid are ignored.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Oth-
erwise, a value of -1 is returned and errno is set to indi-
cate the error.
ERRORS
A quotactl() call will fail when one of the following
occurs:
EINVAL The kernel has not been compiled with the
option.
EINVAL cmd is invalid.
ESRCH No disc quota is found for the indicated user
or quotas have not been turned on for this
file system.
EPERM The call is privileged and the caller was not
the super-user.
ENODEV special is not a mounted FFS file system.
ENOTBLK special is not a block device.
EACCES (QQUOTAON) The quota file pointed to by addr
exists but is either not a regular file or is
not on the file system pointed to by special.
EBUSY attempted while another or is in progress.
EUSERS The quota table is full.
ENOENT The file specified by special or addr does
not exist.
EFAULT addr or special are invalid.
SEE ALSO
getrlimit(2-BSD), mount(2-SysV), mount(2-BSD).
quota(1) in the User's Reference Manual.
mount(1M), quotacheck(1M), quotaon(1M) in the System
Administrator's Reference Manual.
WARNING
There should be some way to integrate this call with the
resource limit interface provided by setrlimit and
getrlimit(2).
Page 2 Printed 1/15/91
QUOTACTL(2-BSD) RISC/os Reference Manual QUOTACTL(2-BSD)
Incompatible with Melbourne quotas.
Printed 1/15/91 Page 3