quota(2) [ultrix man page]
quota(2) System Calls Manual quota(2) Name quota - manipulate disk quotas Syntax #include <sys/types.h> #include <sys/param.h> #include <sys/quota.h> quota(cmd, uid, arg, addr) int cmd, uid, arg; caddr_t addr; Description The call manipulates disk quotas for file systems that have had quotas enabled with The cmd parameter indicates a command in the following list that is applied to the user ID uid. The arg parameter is a command specific argument and addr is the address of an optional, command specific data structure, which is copied in or out of the system. The interpretation of arg and addr is given with each command in the list that follows: Q_SETDLIM Set disk quota limits and current usage for the user with ID uid. The arg parameter is a major-minor device indicating a particular file system. The addr parameter is a pointer to a struct dqblk structure, defined in <sys/quota.h>. Only the superuser can issue this call. Q_GETDLIM Get disk quota limits and current use for the user with ID uid. The remaining parameters are identical to the Q_SETDLIM command parameters. Q_SETDUSE Set disk use limits for the user with ID uid. The arg parameter is a major-minor device indicating a particular file system. The addr is a pointer to a struct dqusage structure, defined in <sys/quota.h>. Only the superuser can issue this call. Q_SYNC Update the on-disk copy of quota uses. The uid, arg, and addr parameters are ignored. Q_SETUID Change the calling process's quota limits to those of the user with ID uid. The arg and addr parameters are ignored. Only the superuser can issue this call. Q_SETWARN Alter the disk usage warning limits for the user with ID uid. The arg is a major-minor device indicating a particular file system. The addr parameter is a pointer to a struct dqwarn structure, which is defined in <sys/quota.h>. Only the superuse can issue this call. Q_DOWARN Warn the user with user ID uid about excessive disk use. This call causes the system to check its current disk use information and print a message on the terminal of the caller for each file system on which the user is over quota. If the arg parameter is speci- fied as NODEV, all file systems that have disk quotas are checked. Otherwise, arg indicates a specific major-minor device to be checked. Only the superuser can issue this call. Return Values A successful call returns 0 and, possibly, more information specific to the command specified in the cmd parameter; when an error occurs, the value -1 is returned and the global variable errno is set to indicate the reason. Diagnostics A quota call fails when one of the following occurs: [EINVAL] The kernel has not been compiled with the QUOTA option. [EINVAL] The cmd parameter is invalid. [ESRCH] No disk quota is found for the indicated user. [EPERM] Only the superuser can issue the call and the caller is not the superuser. [ENODEV] The arg parameter is being interpreted as a major-minor device, and it indicates an unmounted file system. [EFAULT] An invalid addr parameter is supplied; the associated structure could not be copied in or out of the kernel. [EUSERS] The quota table is full. See Also "Disk Quotas in a UNIX Environment", ULTRIX Supplementary Documents, Volume 3:System Manager quota(2)
Check Out this Related Man Page
QUOTA(2) System Calls Manual QUOTA(2) NAME
quota - manipulate disk quotas SYNOPSIS
#include <sys/quota.h> quota(cmd, uid, arg, addr) int cmd, uid, arg; char *addr; DESCRIPTION
The quota call manipulates disk quotas for file systems that have had quotas enabled with setquota(2). The cmd parameter indicates a com- mand to be applied to the user ID uid. Arg is a command specific argument and addr is the address of an optional, command specific, data structure that is copied in or out of the system. The interpretation of arg and addr is given with each command below. Q_SETDLIM Set disc quota limits and current usage for the user with ID uid. Arg is a major-minor device indicating a particular file system. Addr is a pointer to a struct dqblk structure (defined in <sys/quota.h>). This call is restricted to the super-user. Q_GETDLIM Get disc quota limits and current usage for the user with ID uid. The remaining parameters are as for Q_SETDLIM. Q_SETDUSE Set disc usage limits for the user with ID uid. Arg is a major-minor device indicating a particular file system. Addr is a pointer to a struct dqusage structure (defined in <sys/quota.h>). This call is restricted to the super-user. Q_SYNC Update the on-disc copy of quota usages. Arg is a major-minor device indicating the file system to be sync'ed. If the arg parame- ter is specified as NODEV, all file systems that have disc quotas will be sync'ed. The uid and addr parameters are ignored. Q_SETUID Change the calling process's quota limits to those of the user with ID uid. The arg and addr parameters are ignored. This call is restricted to the super-user. Q_SETWARN Alter the disc usage warning limits for the user with ID uid. Arg is a major-minor device indicating a particular file system. Addr is a pointer to a struct dqwarn structure (defined in <sys/quota.h>). This call is restricted to the super-user. Q_DOWARN Warn the user with user ID uid about excessive disc usage. This call causes the system to check its current disc usage information and print a message on the terminal of the caller for each file system on which the user is over quota. If the user is under quota, his warning count is reset to MAX_*_WARN (defined in <sys/quota.h>). If the arg parameter is specified as NODEV, all file systems that have disc quotas will be checked. Otherwise, arg indicates a specific major-minor device to be checked. This call is restricted to the super-user. RETURN VALUE
A successful call returns 0, otherwise the value -1 is returned and the global variable errno indicates the reason for the failure. ERRORS
A quota call will fail when one of the following occurs: [EINVAL] The kernel has not been compiled with the QUOTA option. [EINVAL] Cmd is invalid. [ESRCH] No disc quota is found for the indicated user. [EPERM] The call is priviledged and the caller was not the super-user. [ENODEV] The arg parameter is being interpreted as a major-minor device and it indicates an unmounted file system. [EFAULT] An invalid addr is supplied; the associated structure could not be copied in or out of the kernel. [EUSERS] The quota table is full. SEE ALSO
setquota(2), 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). The Australian spelling of disk is used throughout the quota facilities in honor of the implementors. 4.2 Berkeley Distribution May 15, 1986 QUOTA(2)