1 QUOTACTL(7I)                    Ioctl Requests                    QUOTACTL(7I)
   2 
   3 NAME
   4      quotactl - manipulate disk quotas
   5 
   6 SYNOPSIS
   7      #include <sys/fs/ufs_quota.h>
   8 
   9      int ioctl(int fd, Q_QUOTACTL, struct quotctl *qp);
  10 
  11 DESCRIPTION
  12      This ioctl() call manipulates disk quotas.  fd is the file descriptor
  13      returned by the open(2) system call after opening the quotas file
  14      (located in the root directory of the filesystem running quotas).
  15      Q_QUOTACTL is defined in /usr/include/sys/fs/ufs_quota.h.  qp is the
  16      address of the quotctl structure which is defined as
  17 
  18        struct quotctl {
  19          int op;
  20          uid_t uid;
  21          caddr_t addr;
  22        };
  23 
  24      op indicates an operation to be applied to the user ID uid.  (See below.)
  25      addr is the address of an optional, command specific, data structure
  26      which is copied in or out of the system.  The interpretation of addr is
  27      given with each value of op below.
  28 
  29      Q_QUOTAON   Turn on quotas for a file system.  addr points to the full
  30                  pathname of the quotas file.  uid is ignored.  It is
  31                  recommended that uid have the value of 0.  This call is
  32                  restricted to the super-user.
  33 
  34      Q_QUOTAOFF  Turn off quotas for a file system.  addr and uid are ignored.
  35                  It is recommended that addr have the value of NULL and uid
  36                  have the value of 0.  This call is restricted to the super-
  37                  user.
  38 
  39      Q_GETQUOTA  Get disk quota limits and current usage for user uid.  addr
  40                  is a pointer to a dqblk structure (defined in
  41                  <sys/fs/ufs_quota.h>).    Only the super-user may get the
  42                  quotas of a user other than himself.
  43 
  44      Q_SETQUOTA  Set disk quota limits and current usage for user uid.  addr
  45                  is a pointer to a dqblk structure (defined in
  46                  <sys/fs/ufs_quota.h>).    This call is restricted to the super-
  47                  user.
  48 
  49      Q_SETQLIM   Set disk quota limits for user uid.  addr is a pointer to a
  50                  dqblk structure (defined in <sys/fs/ufs_quota.h>).  This call
  51                  is restricted to the super-user.
  52 
  53      Q_SYNC      Update the on-disk copy of quota usages for this file system.
  54                  addr and uid are ignored.
  55 
  56      Q_ALLSYNC   Update the on-disk copy of quota usages for all file systems
  57                  with active quotas.  addr and uid are ignored.
  58 
  59 RETURN VALUES
  60      This Fn ioctl returns:
  61 
  62      0   on success.
  63 
  64      -1  on failure and sets errno to indicate the error.
  65 
  66 FILES
  67      /usr/include/sys/fs/ufs_quota.h
  68         quota-related structure/function definitions and defines
  69 
  70 ERRORS
  71      EFAULT  addr is invalid.
  72 
  73      EINVAL  The kernel has not been compiled with the QUOTA option.  op is
  74              invalid.
  75 
  76      ENOENT  The quotas file specified by addr does not exist.
  77 
  78      EPERM   The call is privileged and the calling process did not assert
  79              {PRIV_SYS_MOUNT} in the effective set.
  80 
  81      ESRCH   No disk quota is found for the indicated user.  Quotas have not
  82              been turned on for this file system.
  83 
  84      EUSERS  The quota table is full.
  85 
  86      If op is Q_QUOTAON, ioctl() may set errno to:
  87 
  88      EACCES  The quota file pointed to by addr exists but is not a regular
  89              file.  The quota file pointed to by addr exists but is not on the
  90              file system pointed to by special.
  91 
  92      EIO     Internal I/O error while attempting to read the quotas file
  93              pointed to by addr.
  94 
  95 SEE ALSO
  96      quota(1M), quotacheck(1M), quotaon(1M), getrlimit(2), mount(2)
  97 
  98 BUGS
  99      There should be some way to integrate this call with the resource limit
 100      interface provided by setrlimit(2) and getrlimit(2).
 101 
 102      This call is incompatible with Melbourne quotas.
 103 
 104 illumos                        October 28, 2017                        illumos