QUOTA(2) UNIX Programmer's Manual QUOTA(2) NAME quota - manipulate disk quotas SYNOPSIS #include quota(cmd, uid, arg, addr) int cmd, uid, arg; char *addr; DESCRIPTION The _q_u_o_t_a call manipulates disk quotas for file systems that have had quotas enabled with _s_e_t_q_u_o_t_a(2). The _c_m_d parameter indicates a command to be applied to the user ID _u_i_d. _A_r_g is a command specific argument and _a_d_d_r is the address of an optional, command specific, data structure that is copied in or out of the system. The interpretation of _a_r_g and _a_d_d_r is given with each command below. Q_SETDLIM Set disc quota limits and current usage for the user with ID _u_i_d. _A_r_g is a major-minor device indicating a particular file system. _A_d_d_r is a pointer to a struct dqblk structure (defined in <_s_y_s/_q_u_o_t_a._h>). This call is restricted to the super-user. Q_GETDLIM Get disc quota limits and current usage for the user with ID _u_i_d. The remaining parameters are as for Q_SETDLIM. Q_SETDUSE Set disc usage limits for the user with ID _u_i_d. _A_r_g is a major-minor device indicating a particular file sys- tem. _A_d_d_r is a pointer to a struct dqusage structure (defined in <_s_y_s/_q_u_o_t_a._h>). This call is restricted to the super-user. Q_SYNC Update the on-disc copy of quota usages. _A_r_g is a major-minor device indicating the file system to be sync'ed. If the _a_r_g parameter is specified as NODEV, all file systems that have disc quotas will be sync'ed. The _u_i_d and _a_d_d_r parameters are ignored. Q_SETUID Change the calling process's quota limits to those of the user with ID _u_i_d. The _a_r_g and _a_d_d_r parameters are ignored. This call is restricted to the super-user. Q_SETWARN Alter the disc usage warning limits for the user with Printed 11/26/99 May 15, 1986 1 QUOTA(2) UNIX Programmer's Manual QUOTA(2) ID _u_i_d. _A_r_g is a major-minor device indicating a par- ticular file system. _A_d_d_r is a pointer to a struct dqwarn structure (defined in <_s_y_s/_q_u_o_t_a._h>). This call is restricted to the super-user. Q_DOWARN Warn the user with user ID _u_i_d 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 <_s_y_s/_q_u_o_t_a._h>). If the _a_r_g parameter is specified as NODEV, all file systems that have disc quotas will be checked. Otherwise, _a_r_g 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 _e_r_r_n_o indicates the reason for the failure. ERRORS A _q_u_o_t_a call will fail when one of the following occurs: [EINVAL] The kernel has not been compiled with the QUOTA option. [EINVAL] _C_m_d 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 _a_r_g parameter is being interpreted as a major-minor device and it indicates an unmounted file system. [EFAULT] An invalid _a_d_d_r 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 Printed 11/26/99 May 15, 1986 2 QUOTA(2) UNIX Programmer's Manual QUOTA(2) resource limit interface provided by _s_e_t_r_l_i_m_i_t(2) and _g_e_t_r_l_i_m_i_t(2). The Australian spelling of _d_i_s_k is used throughout the quota facilities in honor of the implementors. Printed 11/26/99 May 15, 1986 3