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