QUOTACTL(7I) Ioctl Requests QUOTACTL(7I) NNAAMMEE qquuoottaaccttll - manipulate disk quotas SSYYNNOOPPSSIISS ##iinncclluuddee <> iinntt iiooccttll(_i_n_t _f_d, _Q___Q_U_O_T_A_C_T_L, _s_t_r_u_c_t _q_u_o_t_c_t_l _*_q_p); DDEESSCCRRIIPPTTIIOONN This iiooccttll() call manipulates disk quotas. _f_d is the file descriptor returned by the open(2) system call after opening the _q_u_o_t_a_s file (located in the root directory of the filesystem running quotas). Q_QUOTACTL is defined in _/_u_s_r_/_i_n_c_l_u_d_e_/_s_y_s_/_f_s_/_u_f_s___q_u_o_t_a_._h. _q_p is the address of the _q_u_o_t_c_t_l structure which is defined as struct quotctl { int op; uid_t uid; caddr_t addr; }; _o_p indicates an operation to be applied to the user IIDD _u_i_d. (See below.) _a_d_d_r is the address of an optional, command specific, data structure which is copied in or out of the system. The interpretation of _a_d_d_r is given with each value of _o_p below. QQ__QQUUOOTTAAOONN Turn on quotas for a file system. _a_d_d_r points to the full pathname of the _q_u_o_t_a_s file. _u_i_d is ignored. It is recommended that _u_i_d have the value of 00. This call is restricted to the super-user. Q_QUOTAOFF Turn off quotas for a file system. _a_d_d_r and _u_i_d are ignored. It is recommended that _a_d_d_r have the value of NNUULLLL and _u_i_d have the value of 00. This call is restricted to the super- user. Q_GETQUOTA Get disk quota limits and current usage for user _u_i_d. _a_d_d_r is a pointer to a _d_q_b_l_k structure (defined in <_s_y_s_/_f_s_/_u_f_s___q_u_o_t_a_._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 _u_i_d. _a_d_d_r is a pointer to a _d_q_b_l_k structure (defined in <_s_y_s_/_f_s_/_u_f_s___q_u_o_t_a_._h>). This call is restricted to the super- user. Q_SETQLIM Set disk quota limits for user _u_i_d. _a_d_d_r is a pointer to a _d_q_b_l_k structure (defined in <_s_y_s_/_f_s_/_u_f_s___q_u_o_t_a_._h>). This call is restricted to the super-user. Q_SYNC Update the on-disk copy of quota usages for this file system. _a_d_d_r and _u_i_d are ignored. Q_ALLSYNC Update the on-disk copy of quota usages for all file systems with active quotas. _a_d_d_r and _u_i_d are ignored. RREETTUURRNN VVAALLUUEESS This Fn ioctl returns: 00 on success. --11 on failure and sets _e_r_r_n_o to indicate the error. FFIILLEESS _/_u_s_r_/_i_n_c_l_u_d_e_/_s_y_s_/_f_s_/_u_f_s___q_u_o_t_a_._h quota-related structure/function definitions and defines EERRRROORRSS EFAULT _a_d_d_r is invalid. EINVAL The kernel has not been compiled with the QQUUOOTTAA option. _o_p is invalid. ENOENT The _q_u_o_t_a_s file specified by _a_d_d_r does not exist. EPERM The call is privileged and the calling process did not assert {PPRRIIVV__SSYYSS__MMOOUUNNTT} 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 _o_p is Q_QUOTAON, iiooccttll() may set _e_r_r_n_o to: EACCES The quota file pointed to by _a_d_d_r exists but is not a regular file. The quota file pointed to by _a_d_d_r exists but is not on the file system pointed to by _s_p_e_c_i_a_l. EIO Internal I/O error while attempting to read the _q_u_o_t_a_s file pointed to by _a_d_d_r. SSEEEE AALLSSOO quota(1M), quotacheck(1M), quotaon(1M), getrlimit(2), mount(2) BBUUGGSS There should be some way to integrate this call with the resource limit interface provided by setrlimit(2) and getrlimit(2). This call is incompatible with Melbourne quotas. illumos October 28, 2017 illumos