int
quotactl(
const char *path
, int cmd
, int id
, void *addr
)
)
call enables, disables and
manipulates filesystem quotas.
A quota control command
given by
cmd
operates on the given filename
path
for the given user
id
.
The address of an optional command specific data structure,
addr
,
may be given; its interpretation
is discussed below with each command.
Currently quotas are supported only for the ``ffs''
and ``lfs'' filesystem.
For both of them,
a command is composed of a primary command (see below)
and a command type used to interpret the
id
.
Types are supported for interpretation of user identifiers
and group identifiers.
The ``ffs'' and ``lfs'' specific commands are:
Q_QUOTAON
path
.
The command type specifies the type of the quotas being enabled.
The
addr
argument specifies a file from which to take the quotas.
The quota file must exist;
it is normally created with the
quotacheck(8)
program.
The
id
argument is unused.
Only the super-user may turn quotas on.
Q_QUOTAOFF
path
.
The command type specifies the type of the quotas being disabled.
The
addr
and
id
arguments are unused.
Only the super-user may turn quotas off.
Q_GETQUOTA
id
.
addr
is a pointer to a
struct
dqblk
structure (defined in
<
ufs/ufs/quota.h
>).
Q_SETQUOTA
id
.
addr
is a pointer to a
struct
dqblk
structure (defined in
<
ufs/ufs/quota.h
>).
The usage fields of the
dqblk
structure are ignored.
This call is restricted to the super-user.
Q_SETUSE
id
.
addr
is a pointer to a
struct
dqblk
structure (defined in
<
ufs/ufs/quota.h
>).
Only the usage fields are used.
This call is restricted to the super-user.
Q_SYNC
id
and
addr
parameters are ignored.
)
call will fail if:
EOPNOTSUPP
]
QUOTA
option.
EUSERS
]
EINVAL
]
cmd
or the command type is invalid.
EACCES
]
Q_QUOTAON
,
the quota file is not a plain file, or
search permission is denied for a component of a path prefix.
ENOTDIR
]
ENAMETOOLONG
]
{NAME_MAX}
characters, or an entire path name exceeded
{PATH_MAX}
characters.
ENOENT
]
ELOOP
]
EROFS
]
Q_QUOTAON
,
the quota file resides on a read-only filesystem.
EIO
]
EFAULT
]
path
points outside the process's allocated address space, or
an invalid
addr
was supplied; the associated structure could not be copied in or out
of the kernel.
EPERM
]
)
function call appeared in
4.3BSDReno.