1QUOTA(2)                      System Calls Manual                     QUOTA(2)
2
3
4

NAME

6       quota - manipulate disk quotas
7

SYNOPSIS

9       #include <sys/quota.h>
10
11       quota(cmd, uid, arg, addr)
12       int cmd, uid, arg;
13       char *addr;
14

DESCRIPTION

16       The  quota  call manipulates disk quotas for file systems that have had
17       quotas enabled with setquota(2).  The cmd parameter indicates a command
18       to  be  applied to the user ID uid.  Arg is a command specific argument
19       and addr is the address of an optional, command specific,  data  struc‐
20       ture that is copied in or out of the system.  The interpretation of arg
21       and addr is given with each command below.
22
23       Q_SETDLIM
24              Set disc quota limits and current usage for  the  user  with  ID
25              uid.   Arg  is a major-minor device indicating a particular file
26              system.  Addr is a pointer to a struct dqblk structure  (defined
27              in <sys/quota.h>).  This call is restricted to the super-user.
28
29       Q_GETDLIM
30              Get  disc  quota  limits  and current usage for the user with ID
31              uid.  The remaining parameters are as for Q_SETDLIM.
32
33       Q_SETDUSE
34              Set disc usage limits for the user with ID uid.  Arg is a major-
35              minor  device  indicating  a  particular file system.  Addr is a
36              pointer   to   a   struct   dqusage   structure   (defined    in
37              <sys/quota.h>).  This call is restricted to the super-user.
38
39       Q_SYNC Update  the  on-disc copy of quota usages.  Arg is a major-minor
40              device indicating the file system to be  sync'ed.   If  the  arg
41              parameter is specified as NODEV, all file systems that have disc
42              quotas will  be  sync'ed.   The  uid  and  addr  parameters  are
43              ignored.
44
45       Q_SETUID
46              Change  the  calling process's quota limits to those of the user
47              with ID uid.  The arg and addr  parameters  are  ignored.   This
48              call is restricted to the super-user.
49
50       Q_SETWARN
51              Alter  the  disc  usage warning limits for the user with ID uid.
52              Arg is a major-minor device indicating a particular file system.
53              Addr  is  a  pointer  to  a  struct dqwarn structure (defined in
54              <sys/quota.h>).  This call is restricted to the super-user.
55
56       Q_DOWARN
57              Warn the user with user ID uid about excessive disc usage.  This
58              call  causes the system to check its current disc usage informa‐
59              tion and print a message on the terminal of the caller for  each
60              file  system  on  which  the user is over quota.  If the user is
61              under quota, his warning count is reset to  MAX_*_WARN  (defined
62              in  <sys/quota.h>).  If the arg parameter is specified as NODEV,
63              all file systems that have disc quotas will be checked.   Other‐
64              wise, arg indicates a specific major-minor device to be checked.
65              This call is restricted to the super-user.
66

RETURN VALUE

68       A successful call returns 0, otherwise the value -1 is returned and the
69       global variable errno indicates the reason for the failure.
70

ERRORS

72       A quota call will fail when one of the following occurs:
73
74       [EINVAL]       The kernel has not been compiled with the QUOTA option.
75
76       [EINVAL]       Cmd is invalid.
77
78       [ESRCH]        No disc quota is found for the indicated user.
79
80       [EPERM]        The  call  is  priviledged  and  the  caller was not the
81                      super-user.
82
83       [ENODEV]       The arg parameter is being interpreted as a  major-minor
84                      device and it indicates an unmounted file system.
85
86       [EFAULT]       An  invalid  addr  is supplied; the associated structure
87                      could not be copied in or out of the kernel.
88
89       [EUSERS]       The quota table is full.
90

SEE ALSO

92       setquota(2), quotaon(8), quotacheck(8)
93

BUGS

95       There should be some way to integrate this call with the resource limit
96       interface provided by setrlimit(2) and getrlimit(2).
97
98       The Australian spelling of disk is used throughout the quota facilities
99       in honor of the implementors.
100
101
102
1034.2 Berkeley Distribution        May 15, 1986                         QUOTA(2)
Impressum