1quotactl(7I)                    Ioctl Requests                    quotactl(7I)
2
3
4

NAME

6       quotactl - manipulate disk quotas
7

SYNOPSIS

9       #include <sys/fs/ufs_quota.h>
10       int ioctl(int fd, Q_QUOTACTL, struct quotcl *qp)
11
12

DESCRIPTION

14       This  ioctl()  call  manipulates disk quotas. fd is the file descriptor
15       returned by the open()  system  call  after  opening  the  quotas  file
16       (located  in  the  root  directory  of  the filesystem running quotas.)
17       Q_QUOTACTL is defined in  /usr/include/sys/fs/ufs_quota.h.  qp  is  the
18       address of the quotctl structure which is defined as
19
20         struct quotctl {
21           int op;
22           uid_t uid;
23           caddr_t addr;
24         };
25
26
27
28       op  indicates  an  operation  to  be  applied  to the user ID uid. (See
29       below.) addr is the address of  an  optional,  command  specific,  data
30       structure  which  is copied in or out of the system. The interpretation
31       of addr is given with each value of op below.
32
33       Q_QUOTAON     Turn on quotas for a file system. addr points to the full
34                     pathname of the quotas file. uid is ignored. It is recom‐
35                     mended that uid  have  the  value  of  0.  This  call  is
36                     restricted to the super-user.
37
38
39       Q_QUOTAOFF    Turn  off  quotas  for  a  file  system. addr and uid are
40                     ignored. It is recommended that addr have  the  value  of
41                     NULL and uid have the value of 0. This call is restricted
42                     to the super-user.
43
44
45       Q_GETQUOTA    Get disk quota limits and current  usage  for  user  uid.
46                     addr  is  a  pointer  to  a  dqblk  structure (defined in
47                     <sys/fs/ufs_quota.h>). Only the super-user  may  get  the
48                     quotas of a user other than himself.
49
50
51       Q_SETQUOTA    Set  disk  quota  limits  and current usage for user uid.
52                     addr is a  pointer  to  a  dqblk  structure  (defined  in
53                     sys/fs/ufs_quota.h).  This  call  is  restricted  to  the
54                     super-user.
55
56
57       Q_SETQLIM     Set disk quota limits for user uid. addr is a pointer  to
58                     a  dqblk  structure (defined in sys/fs/ufs_quota.h). This
59                     call is restricted to the super-user.
60
61
62       Q_SYNC        Update the on-disk copy of quota  usages  for  this  file
63                     system. addr and uid are ignored.
64
65
66       Q_ALLSYNC     Update the on-disk copy of quota usages for all file sys‐
67                     tems with active quotas. addr and uid are ignored.
68
69

RETURN VALUES

71       This ioctl() returns:
72
73       0        on success.
74
75
76       −1       on failure and sets errno to indicate the error.
77
78

ERRORS

80       EFAULT    addr is invalid.
81
82
83       EINVAL    The kernel has not been compiled with the QUOTA option. op is
84                 invalid.
85
86
87       ENOENT    The quotas file specified by addr does not exist.
88
89
90       EPERM     The call is privileged and the calling process did not assert
91                 {PRIV_SYS_MOUNT} in the effective set.
92
93
94       ESRCH     No disk quota is found for the indicated  user.  Quotas  have
95                 not been turned on for this file system.
96
97
98       EUSERS    The quota table is full.
99
100
101
102       If op is Q_QUOTAON, ioctl() may set errno to:
103
104       EACCES    The quota file pointed to by addr exists but is not a regular
105                 file. The quota file pointed to by addr exists but is not  on
106                 the file system pointed to by special.
107
108
109       EIO       Internal  I/O  error while attempting to read the quotas file
110                 pointed to by addr.
111
112

FILES

114       /usr/include/sys/fs/ufs_quota.h
115
116           quota-related structure/function definitions and defines
117
118

SEE ALSO

120       quota(1M), quotacheck(1M), quotaon(1M), getrlimit(2), mount(2)
121

BUGS

123       There should be some way to integrate this call with the resource limit
124       interface provided by setrlimit() and getrlimit(2).
125
126
127       This call is incompatible with Melbourne quotas.
128
129
130
131SunOS 5.11                       14 June 2004                     quotactl(7I)
Impressum