


Ioctl Requests                                       quotactl(7I)



NAME
     quotactl - manipulate disk quotas

SYNOPSIS
     #include <sys/fs/ufs_quota.h>

     int ioctl(int _f_d, Q_QUOTACTL, struct quotctl *_q_p)

DESCRIPTION
     This ioctl() call manipulates disk quotas.  _f_d 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.  _q_p is the address  of  the
     quotctl 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 ID  _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.

     Q_QUOTAON      Turn on  quotas  for  a  file  system.   _a_d_d_r
                    points  to  the  full  pathname of the quotas
                    file.  _u_i_d is ignored. It is recommended that
                    _u_i_d  have  the value of 0.  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. It is recommended that _a_d_d_r
                    have the value of NULL and _u_i_d have the value
                    of  0.  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  <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  _u_i_d.   _a_d_d_r  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 _u_i_d.  _a_d_d_r  is



SunOS 5.6           Last change: 14 Sep 1995                    1






Ioctl Requests                                       quotactl(7I)



                    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.  _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.

RETURN VALUES
     This ioctl() returns:

     0              on success.

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

ERRORS
     EFAULT         _a_d_d_r is invalid.

     EINVAL         The kernel has not  been  compiled  with  the
                    QUOTA option.
                    _o_p is invalid.

     ENOENT         The quotas file specified by  _a_d_d_r  does  not
                    exist.

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

     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, ioctl() 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.

     EIO            Internal I/O error while attempting  to  read
                    the quotas file pointed to by _a_d_d_r.

FILES
     /usr/include/sys/fs/ufs_quota.h



SunOS 5.6           Last change: 14 Sep 1995                    2






Ioctl Requests                                       quotactl(7I)



                         quota-related structure/function defini-
                         tions 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.6           Last change: 14 Sep 1995                    3



