All rights reserved.
This code is derived from software contributed to Berkeley by
Robert Elz at The University of Melbourne.
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@(#)quotactl.2 6.10 (Berkeley) 05/06/90
quotactl(path, cmd, id, addr) char *path; int cmd, id; char *addr;
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 id . Types are supported for interpretation of user identifiers and group identifiers. The ``ufs'' specific commands are:
Q_QUOTAON Enable disk quotas for the filesystem specified by 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 Disable disk quotas for the filesystem specified by 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 Get disk quota limits and current usage for the user or group (as determined by the command type) with identifier id . Addr is a pointer to a struct dqblk structure (defined in < ufs/quota.h >).
Q_SETQUOTA Set disk quota limits for the user or group (as determined by the command type) with identifier id . Addr is a pointer to a struct dqblk structure (defined in < ufs/quota.h >). The usage fields of the dqblk structure are ignored. This call is restricted to the super-user.
Q_SETUSE Set disk usage limits for the user or group (as determined by the command type) with identifier id . Addr is a pointer to a struct dqblk structure (defined in < ufs/quota.h >). Only the usage fields are used. This call is restricted to the super-user.
Q_SYNC Update the on-disk copy of quota usages. The command type specifies which type of quotas are to be updated. The id and addr parameters are ignored.
15 [EOPNOTSUPP] The kernel has not been compiled with the QUOTA option.
15 [EUSERS] The quota table cannot be expanded.
15 [EINVAL] Cmd or the command type is invalid.
15 [EINVAL] A pathname contains a character with the high-order bit set.
15 [EACCES] In Q_QUOTAON, the quota file is not a plain file.
15 [EACCES] Search permission is denied for a component of a path prefix.
15 [ENOTDIR] A component of a path prefix is not a directory.
15 [ENAMETOOLONG] A component of either pathname exceeded 255 characters, or the entire length of either path name exceeded 1023 characters.
15 [ENOENT] A filename does not exist.
15 [ELOOP] Too many symbolic links were encountered in translating a pathname.
15 [EROFS] In Q_QUOTAON, the quota file resides on a read-only filesystem.
15 [EIO] An I/O error occurred while reading from or writing to a file containing quotas.
15 [EFAULT] An invalid addr is supplied; the associated structure could not be copied in or out of the kernel.
15 [EFAULT] Path points outside the process's allocated address space.
15 [EPERM] The call is privileged and the caller was not the super-user.