BSD 4_3_Net_2 release
[unix-history] / usr / src / lib / libc / sys / quotactl.2
index 25bd791..e277452 100644 (file)
-.\" Copyright (c) 1983, 1990 Regents of the University of California.
+.\" Copyright (c) 1983, 1990, 1991 Regents of the University of California.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Robert Elz at The University of Melbourne.
 .\"
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" Robert Elz at The University of Melbourne.
 .\"
-.\" %sccs.include.redist.man%
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"    @(#)quotactl.2  6.11 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
 .\"
 .\"
-.TH QUOTACTL 2 ""
-.UC 7
-.SH NAME
-quotactl \- manipulate disk quotas
-.SH SYNOPSIS
-.BI "#include <ufs/quota.h>" " /* for ``ufs'' quotas */"
-.PP
-.nf
-.B quotactl(path, cmd, id, addr)
-.B char *path;
-.B int cmd, id;
-.B char *addr;
-.fi
-.SH DESCRIPTION
-The
-.I quotactl
-call is used to enable and disable quotas and
-to manipulate disk quotas for filesystems on
-which quotas have been enabled.
-.I Path
-is the path name of any file within the mounted filesystem
-to which the quota control command is to be applied.
+.\"    @(#)quotactl.2  6.13 (Berkeley) 7/23/91
+.\"
+.Dd July 23, 1991
+.Dt QUOTACTL 2
+.Os
+.Sh NAME
+.Nm quotactl
+.Nd manipulate filesystem quotas
+.Sh SYNOPSIS
+.Ft #include <ufs/quota.h>     /* for ufs quotas */
+.Ft int
+.Fn quotactl "const char *path" "int cmd" "int id" "char *addr"
+.Sh DESCRIPTION
 The
 The
-.I cmd
-parameter indicates a command to be applied to the
-.IR id .
-.I Addr
-is the address of an optional, command specific, data structure
-that is copied in or out of the system.  The interpretation of
-.I addr
-is given with each command.
-.PP
+.Fn quotactl
+call enables, disables and
+manipulates filesystem quotas.
+A quota control command
+given by
+.Fa cmd
+operates on the given filename
+.Fa path
+for the given user
+.Fa id .
+The address of an optional command specific data structure,
+.Fa addr ,
+may be given; its interpretation
+is discussed below with each command.
+.Pp
 Currently quotas are supported only for the ``ufs'' filesystem.
 For ``ufs'',
 a command is composed of a primary command (see below)
 Currently quotas are supported only for the ``ufs'' filesystem.
 For ``ufs'',
 a command is composed of a primary command (see below)
-and a command type that is used to interpret the
-.IR id .
+and a command type used to interpret the
+.Fa id .
 Types are supported for interpretation of user identifiers
 and group identifiers.
 The ``ufs'' specific commands are:
 Types are supported for interpretation of user identifiers
 and group identifiers.
 The ``ufs'' specific commands are:
-.TP
-Q_QUOTAON
+.Bl -tag -width Q_QUOTAON
+.It Dv Q_QUOTAON
 Enable disk quotas for the filesystem specified by
 Enable disk quotas for the filesystem specified by
-.IR path .
+.Fa path .
 The command type specifies the type of the quotas being enabled.
 The
 The command type specifies the type of the quotas being enabled.
 The
-.I addr
+.Fa addr
 argument specifies a file from which to take the quotas.
 The quota file must exist;
 it is normally created with the 
 argument specifies a file from which to take the quotas.
 The quota file must exist;
 it is normally created with the 
-.IR quotacheck (8)
+.Xr quotacheck 8
 program.
 The
 program.
 The
-.I id
+.Fa id
 argument is unused.
 Only the super-user may turn quotas on.
 argument is unused.
 Only the super-user may turn quotas on.
-.TP
-Q_QUOTAOFF
+.It Dv Q_QUOTAOFF
 Disable disk quotas for the filesystem specified by
 Disable disk quotas for the filesystem specified by
-.I path .
+.Fa path .
 The command type specifies the type of the quotas being disabled.
 The
 The command type specifies the type of the quotas being disabled.
 The
-.I addr
+.Fa addr
 and
 and
-.I id
+.Fa id
 arguments are unused.
 Only the super-user may turn quotas off.
 arguments are unused.
 Only the super-user may turn quotas off.
-.TP
-Q_GETQUOTA
+.It Dv Q_GETQUOTA
 Get disk quota limits and current usage for the user or group
 (as determined by the command type) with identifier
 Get disk quota limits and current usage for the user or group
 (as determined by the command type) with identifier
-.IR id .
-.I Addr
-is a pointer to a struct dqblk structure (defined in 
-.RI < ufs/quota.h >).
-.TP
-Q_SETQUOTA
+.Fa id .
+.Fa Addr
+is a pointer to a
+.Fa struct dqblk
+structure (defined in 
+.Ao Pa ufs/quota.h Ac ) .
+.It Dv Q_SETQUOTA
 Set disk quota limits for the user or group
 (as determined by the command type) with identifier
 Set disk quota limits for the user or group
 (as determined by the command type) with identifier
-.IR id .
-.I Addr
-is a pointer to a struct dqblk structure (defined in 
-.RI < ufs/quota.h >).
-The usage fields of the dqblk structure are ignored.
+.Fa id .
+.Fa Addr
+is a pointer to a
+.Fa struct dqblk
+structure (defined in 
+.Ao Pa ufs/quota.h Ac ) .
+The usage fields of the
+.Fa dqblk
+structure are ignored.
 This call is restricted to the super-user.
 This call is restricted to the super-user.
-.TP
-Q_SETUSE
+.It Dv Q_SETUSE
 Set disk usage limits for the user or group
 (as determined by the command type) with identifier
 Set disk usage limits for the user or group
 (as determined by the command type) with identifier
-.IR id .
-.I Addr
-is a pointer to a struct dqblk structure (defined in
-.RI < ufs/quota.h >).
+.Fa id .
+.Fa Addr
+is a pointer to a
+.Fa struct dqblk
+structure (defined in
+.Ao Pa ufs/quota.h Ac ) .
 Only the usage fields are used.
 This call is restricted to the super-user.
 Only the usage fields are used.
 This call is restricted to the super-user.
-.TP
-Q_SYNC
+.It Dv Q_SYNC
 Update the on-disk copy of quota usages.
 The command type specifies which type of quotas are to be updated.
 Update the on-disk copy of quota usages.
 The command type specifies which type of quotas are to be updated.
-The \fIid\fP and \fIaddr\fP parameters are ignored.
-.SH "RETURN VALUE"
+The
+.Fa id
+and
+.Fa addr
+parameters are ignored.
+.El
+.Sh RETURN VALUES
 A successful call returns 0,
 A successful call returns 0,
-otherwise the value \-1 is returned and the global variable
-.I errno
+otherwise the value -1 is returned and the global variable
+.Va errno
 indicates the reason for the failure.
 indicates the reason for the failure.
-.SH ERRORS
-A \fIquotactl\fP call will fail when one of the following occurs:
-.TP 15
-[EOPNOTSUPP]
-The kernel has not been compiled with the QUOTA option.
-.TP 15
-[EUSERS]
+.Sh ERRORS
+A
+.Fn quotactl
+call will fail if:
+.Bl -tag -width ENAMETOOLONGAA
+.It Bq Er EOPNOTSUPP
+The kernel has not been compiled with the
+.Dv QUOTA
+option.
+.It Bq Er EUSERS
 The quota table cannot be expanded.
 The quota table cannot be expanded.
-.TP 15
-[EINVAL]
-.I Cmd
+.It Bq Er EINVAL
+.Fa Cmd
 or the command type is invalid.
 or the command type is invalid.
-.TP 15
-[EINVAL]
+.It Bq Er EINVAL
 A pathname contains a character with the high-order bit set.
 A pathname contains a character with the high-order bit set.
-.TP 15
-[EACCES]
-In Q_QUOTAON, the quota file is not a plain file.
-.TP 15
-[EACCES]
+.It Bq Er EACCES
+In
+.Dv Q_QUOTAON ,
+the quota file is not a plain file.
+.It Bq Er EACCES
 Search permission is denied for a component of a path prefix.
 Search permission is denied for a component of a path prefix.
-.TP 15
-[ENOTDIR]
-A component of a path prefix is not a directory.
-.TP 15
-[ENAMETOOLONG]
+.It Bq Er ENOTDIR
+A component of a path prefix was not a directory.
+.It Bq Er ENAMETOOLONG
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
 A component of either pathname exceeded 255 characters,
 or the entire length of either path name exceeded 1023 characters.
-.TP 15
-[ENOENT]
+.It Bq Er ENOENT
 A filename does not exist.
 A filename does not exist.
-.TP 15
-[ELOOP]
+.It Bq Er ELOOP
 Too many symbolic links were encountered in translating a pathname.
 Too many symbolic links were encountered in translating a pathname.
-.TP 15
-[EROFS]
-In Q_QUOTAON, the quota file resides on a read-only filesystem.
-.TP 15
-[EIO]
-An I/O error occurred while reading from or writing
+.It Bq Er EROFS
+In
+.Dv Q_QUOTAON ,
+the quota file resides on a read-only filesystem.
+.It Bq Er EIO
+An
+.Tn I/O
+error occurred while reading from or writing
 to a file containing quotas.
 to a file containing quotas.
-.TP 15
-[EFAULT]
+.It Bq Er EFAULT
 An invalid
 An invalid
-.I addr
-is supplied; the associated structure could not be copied in or out
+.Fa addr
+was supplied; the associated structure could not be copied in or out
 of the kernel.
 of the kernel.
-.TP 15
-[EFAULT]
-.I Path
+.It Bq Er EFAULT
+.Fa Path
 points outside the process's allocated address space.
 points outside the process's allocated address space.
-.TP 15
-[EPERM]
-The call is privileged and the caller was not the super-user.
-.SH "SEE ALSO"
-quota(1),
-fstab(5),
-edquota(8), quotacheck(8), quotaon(8), repquota(8)
-.SH BUGS
+.It Bq Er EPERM
+The call was privileged and the caller was not the super-user.
+.El
+.Sh SEE ALSO
+.Xr quota 1 ,
+.Xr fstab 5 ,
+.Xr edquota 8 ,
+.Xr quotacheck 8 ,
+.Xr quotaon 8 ,
+.Xr repquota 8
+.Sh BUGS
 There should be some way to integrate this call with the resource
 limit interface provided by
 There should be some way to integrate this call with the resource
 limit interface provided by
-.IR setrlimit (2)
+.Xr setrlimit 2
 and
 and
-.IR getrlimit (2).
+.Xr getrlimit 2 .
+.Sh HISTORY
+The
+.Nm quotactl
+function call appeared in
+.Bx 4.3 Reno .