1 QUOTACTL(7I) Ioctl Requests QUOTACTL(7I)
2
3
4
5 NAME
6 quotactl - manipulate disk quotas
7
8 SYNOPSIS
9 #include <sys/fs/ufs_quota.h>
10 int ioctl(int fd, Q_QUOTACTL, struct quotcl *qp)
11
12
13 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
34 Turn on quotas for a file system. addr points to the full
35 pathname of the quotas file. uid is ignored. It is
36 recommended that uid have the value of 0. This call is
37 restricted to the super-user.
38
39
40 Q_QUOTAOFF
41 Turn off quotas for a file system. addr and uid are
42 ignored. It is recommended that addr have the value of
43 NULL and uid have the value of 0. This call is restricted
44 to the super-user.
45
46
47 Q_GETQUOTA
48 Get disk quota limits and current usage for user uid.
49 addr is a pointer to a dqblk structure (defined in
50 <sys/fs/ufs_quota.h>). Only the super-user may get the
51 quotas of a user other than himself.
52
53
54 Q_SETQUOTA
55 Set disk quota limits and current usage for user uid.
56 addr is a pointer to a dqblk structure (defined in
57 sys/fs/ufs_quota.h). This call is restricted to the
58 super-user.
59
60
61 Q_SETQLIM
62 Set disk quota limits for user uid. addr is a pointer to
63 a dqblk structure (defined in sys/fs/ufs_quota.h). This
64 call is restricted to the super-user.
65
66
67 Q_SYNC
68 Update the on-disk copy of quota usages for this file
69 system. addr and uid are ignored.
70
71
72 Q_ALLSYNC
73 Update the on-disk copy of quota usages for all file
74 systems with active quotas. addr and uid are ignored.
75
76
77 RETURN VALUES
78 This ioctl() returns:
79
80 0
81 on success.
82
83
84 -1
85 on failure and sets errno to indicate the error.
86
87
88 ERRORS
89 EFAULT
90 addr is invalid.
91
92
93 EINVAL
94 The kernel has not been compiled with the QUOTA option. op is
95 invalid.
96
97
98 ENOENT
99 The quotas file specified by addr does not exist.
100
101
102 EPERM
103 The call is privileged and the calling process did not assert
104 {PRIV_SYS_MOUNT} in the effective set.
105
106
107 ESRCH
108 No disk quota is found for the indicated user. Quotas have
109 not been turned on for this file system.
110
111
112 EUSERS
113 The quota table is full.
114
115
116
117 If op is Q_QUOTAON, ioctl() may set errno to:
118
119 EACCES
120 The quota file pointed to by addr exists but is not a regular
121 file. The quota file pointed to by addr exists but is not on
122 the file system pointed to by special.
123
124
125 EIO
126 Internal I/O error while attempting to read the quotas file
127 pointed to by addr.
128
129
130 FILES
131 /usr/include/sys/fs/ufs_quota.h
132
133 quota-related structure/function definitions and defines
134
135
136 SEE ALSO
137 quota(1M), quotacheck(1M), quotaon(1M), getrlimit(2), mount(2)
138
139 BUGS
140 There should be some way to integrate this call with the resource limit
141 interface provided by setrlimit() and getrlimit(2).
142
143
144 This call is incompatible with Melbourne quotas.
145
146
147
148 June 14, 2004 QUOTACTL(7I)
|
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
|