Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

quota(2) [bsd 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)

Check Out this Related Man Page

quotactl(7I)							  Ioctl Requests						      quotactl(7I)

NAME
quotactl - manipulate disk quotas SYNOPSIS
#include <sys/fs/ufs_quota.h> int ioctl(int fd, Q_QUOTACTL, struct quotcl *qp) DESCRIPTION
This ioctl() call manipulates disk quotas. fd is the file descriptor returned by the open() system call after opening the quotas file (located in the root directory of the filesystem running quotas.) Q_QUOTACTL is defined in /usr/include/sys/fs/ufs_quota.h. qp is the address of the quotctl structure which is defined as struct quotctl { int op; uid_t uid; caddr_t addr; }; op indicates an operation to be applied to the user ID uid. (See below.) addr is the address of an optional, command specific, data struc- ture which is copied in or out of the system. The interpretation of addr is given with each value of op below. Q_QUOTAON Turn on quotas for a file system. addr points to the full pathname of the quotas file. uid is ignored. It is recommended that uid have the value of 0. This call is restricted to the super-user. Q_QUOTAOFF Turn off quotas for a file system. addr and uid are ignored. It is recommended that addr have the value of NULL and uid have the value of 0. 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 <sys/fs/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 sys/fs/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 sys/fs/ufs_quota.h). This call is restricted to the super-user. Q_SYNC Update the on-disk copy of quota usages for this file system. addr and uid are ignored. Q_ALLSYNC Update the on-disk copy of quota usages for all file systems with active quotas. addr and uid are ignored. RETURN VALUES
This ioctl() returns: 0 on success. -1 on failure and sets errno to indicate the error. ERRORS
EFAULT addr is invalid. EINVAL The kernel has not been compiled with the QUOTA option. op is invalid. ENOENT The quotas file specified by addr does not exist. EPERM The call is privileged and the calling process did not assert {PRIV_SYS_MOUNT} in the effective set. ESRCH No disk quota is found for the indicated user. Quotas have not been turned on for this file system. EUSERS The quota table is full. If op is Q_QUOTAON, ioctl() 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. EIO Internal I/O error while attempting to read the quotas file pointed to by addr. FILES
/usr/include/sys/fs/ufs_quota.h quota-related structure/function definitions and defines SEE ALSO
quota(1M), quotacheck(1M), quotaon(1M), getrlimit(2), mount(2) BUGS
There should be some way to integrate this call with the resource limit interface provided by setrlimit() and getrlimit(2). This call is incompatible with Melbourne quotas. SunOS 5.10 14 June 2004 quotactl(7I)
Man Page