


QUOTACTL(2)               SYSTEM CALLS                QUOTACTL(2)



NAME
     quotactl - manipulate disk quotas

SYNOPSIS
     #include <ufs/quota.h>

     int quotactl(cmd, special, uid, addr)
     int cmd;
     char *special;
     int uid;
     caddr_t addr;

DESCRIPTION
     The quotactl() call manipulates disk quotas.  _c_m_d  indicates
     a  command  to  be applied to the user ID _u_i_d.  _s_p_e_c_i_a_l 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  UFS
     file  system  (see  mount(2V)).   _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 command below.

     Q_QUOTAON      Turn on  quotas  for  a  file  system.   _a_d_d_r
                    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(8) program.  This call is res-
                    tricted to the super-user.

     Q_QUOTAOFF     Turn off quotas for a file system.  _a_d_d_r  and
                    _u_i_d  are ignored.  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 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  _u_i_d.   _a_d_d_r  is  a  pointer  to a dqblk
                    structure (defined in quota.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 dqblk structure (defined in
                    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  _s_p_e_c_i_a_l  is null then all



Sun Release 4.1   Last change: 21 January 1990                  1






QUOTACTL(2)               SYSTEM CALLS                QUOTACTL(2)



                    file systems with active quotas are  sync'ed.
                    _a_d_d_r and _u_i_d are ignored.

RETURN VALUES
     quotactl() returns:

     0    on success.

     -1   on failure and sets errno to indicate the error.

ERRORS
     EFAULT         _a_d_d_r or _s_p_e_c_i_a_l are invalid.

     EINVAL         The kernel has not  been  compiled  with  the
                    QUOTA option.

                    _c_m_d is invalid.

     ENODEV         _s_p_e_c_i_a_l is not a mounted UFS file system.

     ENOENT         The file specified by _s_p_e_c_i_a_l  or  _a_d_d_r  does
                    not exist.

     ENOTBLK        _s_p_e_c_i_a_l is not a block device.

     EPERM          The call is privileged and the caller was not
                    the super-user.

     ESRCH          No disc quota  is  found  for  the  indicated
                    user.

                    Quotas have not been turned on for this  file
                    system.

     EUSERS         The quota table is full.

     If _c_m_d is Q_QUOTAON quotactl() may set errno 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.

     EBUSY          Q_QUOTAON attempted while  another  Q_QUOTAON
                    or Q_QUOTAOFF is in progress.

SEE ALSO
     quota(1), getrlimit(2), mount(2V), quotacheck(8), quotaon(8)





Sun Release 4.1   Last change: 21 January 1990                  2






QUOTACTL(2)               SYSTEM CALLS                QUOTACTL(2)



BUGS
     There should be some way to integrate  this  call  with  the
     resource   limit   interface  provided  by  setrlimit()  and
     getrlimit(2).

     Incompatible with Melbourne quotas.

















































Sun Release 4.1   Last change: 21 January 1990                  3



