Commit | Line | Data |
---|---|---|
02b31b1d KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
efa9f401 | 5 | .\" @(#)quotactl.2 6.3 (Berkeley) %G% |
02b31b1d | 6 | .\" |
1bf2a285 | 7 | .TH QUOTA 2 "" |
02b31b1d KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | quota \- manipulate disk quotas | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .B #include <sys/quota.h> | |
14 | .PP | |
15 | .B quota(cmd, uid, arg, addr) | |
16 | .B int cmd, uid, arg; | |
17 | .B caddr_t addr; | |
18 | .fi | |
19 | .SH DESCRIPTION | |
20 | The | |
21 | .I quota | |
22 | call manipulates disk quotas for file systems | |
23 | which have had quotas enabled with | |
24 | .IR setquota (2). | |
25 | The | |
26 | .I cmd | |
27 | parameter indicates a command to be applied to | |
28 | the user ID | |
29 | .IR uid . | |
30 | .I Arg | |
31 | is a command specific argument and | |
32 | .I addr | |
33 | is the address of an optional, command specific, data structure | |
34 | which is copied in or out of the system. The interpretation of | |
35 | .I arg | |
36 | and | |
37 | .I addr | |
38 | is given with each command below. | |
39 | .TP | |
40 | Q_SETDLIM | |
41 | Set disc quota limits and current usage for the user with ID | |
42 | .IR uid . | |
43 | .I Arg | |
44 | is a major-minor device indicating a particular file system. | |
45 | .I Addr | |
46 | is a pointer to a struct dqblk structure (defined in | |
47 | .RI < sys/quota.h >). | |
48 | This call is restricted to the super-user. | |
49 | .TP | |
50 | Q_GETDLIM | |
51 | Get disc quota limits and current usage for the user with ID | |
52 | .IR uid . | |
53 | The remaining parameters are as for Q_SETDLIM. | |
54 | .TP | |
55 | Q_SETDUSE | |
56 | Set disc usage limits for the user with ID | |
57 | .IR uid . | |
58 | .I Arg | |
59 | is a major-minor device indicating a particular file system. | |
60 | .I Addr | |
61 | is a pointer to a struct dqusage structure (defined in | |
62 | .RI < sys/quota.h >). | |
63 | This call is restricted to the super-user. | |
64 | .TP | |
65 | Q_SYNC | |
66 | Update the on-disc copy of quota usages. | |
efa9f401 KM |
67 | .I Arg |
68 | is a major-minor device indicating the file system to be sync'ed. | |
69 | If the | |
70 | .I arg | |
71 | parameter is specified as NODEV, all file systems which have | |
72 | disc quotas will be sync'ed. | |
73 | The \fIuid\fP and \fIaddr\fP parameters are ignored. | |
02b31b1d KM |
74 | .TP |
75 | Q_SETUID | |
76 | Change the calling process's quota limits to those of the | |
77 | user with ID | |
78 | .IR uid . | |
79 | The | |
80 | .I arg | |
81 | and | |
82 | .I addr | |
83 | parameters are ignored. This call is restricted to the super-user. | |
84 | .TP | |
85 | Q_SETWARN | |
86 | Alter the disc usage warning limits for the user with ID | |
87 | .IR uid . | |
88 | .I Arg | |
89 | is a major-minor device indicating a particular file system. | |
90 | .I Addr | |
91 | is a pointer to a struct dqwarn structure (defined in | |
92 | .RI < sys/quota.h >). | |
93 | This call is restricted to the super-user. | |
94 | .TP | |
95 | Q_DOWARN | |
96 | Warn the user with user ID | |
97 | .I uid | |
98 | about excessive disc usage. | |
99 | This call causes the system to check its current disc usage | |
100 | information and print a message on the terminal of | |
101 | the caller for each file system on which the user is over quota. | |
102 | If the | |
103 | .I arg | |
104 | parameter is specified as NODEV, all file systems which have | |
105 | disc quotas will be checked. Otherwise, | |
106 | .I arg | |
107 | indicates a specific major-minor device to be checked. | |
108 | This call is restricted to the super-user. | |
109 | .SH "RETURN VALUE" | |
47fbd25c KM |
110 | A successful call returns 0, |
111 | otherwise the value \-1 is returned and the global variable | |
02b31b1d | 112 | .I errno |
47fbd25c | 113 | indicates the reason for the failure. |
02b31b1d | 114 | .SH ERRORS |
47fbd25c KM |
115 | A \fIquota\fP call will fail when one of the following occurs: |
116 | .TP 15 | |
117 | [EINVAL] | |
118 | The kernel has not been compiled with the QUOTA option. | |
02b31b1d KM |
119 | .TP 15 |
120 | [EINVAL] | |
121 | .I Cmd | |
122 | is invalid. | |
123 | .TP 15 | |
124 | [ESRCH] | |
125 | No disc quota is found for the indicated user. | |
126 | .TP 15 | |
127 | [EPERM] | |
128 | The call is priviledged and the caller was not the super-user. | |
129 | .TP 15 | |
47fbd25c | 130 | [ENODEV] |
02b31b1d KM |
131 | The |
132 | .I arg | |
133 | parameter is being interpreted as a major-minor | |
134 | device and it indicates an unmounted file system. | |
135 | .TP 15 | |
136 | [EFAULT] | |
137 | An invalid | |
138 | .I addr | |
139 | is supplied; the associated structure could not be copied in or out | |
140 | of the kernel. | |
141 | .TP 15 | |
142 | [EUSERS] | |
143 | The quota table is full. | |
144 | .SH "SEE ALSO" | |
145 | setquota(2), quotaon(8), quotacheck(8) | |
146 | .SH BUGS | |
147 | There should be someway to integrate this call with the resource | |
148 | limit interface provided by | |
149 | .IR setrlimit (2) | |
150 | and | |
151 | .IR getrlimit (2). | |
152 | .PP | |
153 | The Australian spelling of | |
154 | .I disk | |
155 | is used throughout the quota facilities in honor of | |
156 | the implementors. |