Manipulates disk quotas.
Standard C Library (libc.a)
The quotactl subroutine enables, disables, and manipulates disk quotas for file systems on which quotas have been enabled.
On AIX®, disk quotas are supported by the legacy Journaled File System (JFS) and the enhanced Journaled File System (JFS2).
The Cmd parameter is constructed through use of the QCMD(Qcmd, type) macro contained within the sys/fs/quota_common.h file. The Qcmd parameter specifies the quota control command. The type parameter specifies either user (USRQUOTA) or group (GRPQUOTA) quota type.
The valid values for the Cmd parameter in all supported file system types are:
Additional JFS specific values for the Cmd parameter are as follows:
Additional JFS2 specific values for the Cmd parameter are as follows:
Item | Description |
---|---|
Path | Specifies the path name of any file within the mounted file system to which the quota control command is to be applied. Typically, this would be the mount point of the file system. |
Cmd | Specifies the quota control command to be applied and whether it is applied to a user or group quota. |
ID | Specifies the user or group ID to which the quota control command applies. The ID parameter is interpreted by the specified quota type. The JFS file system supports quotas for IDs within the range of MINDQUID through MAXDQID; JFS2 supports all IDs. |
Addr | Points to the address of an optional, command-specific, data structure that is copied in or out of the system. The interpretation of the Addr parameter for each quota control command is given above. |
A successful call returns 0; otherwise, the value -1 is returned and the errno global variable indicates the reason for the failure.
A quotactl subroutine will fail when one of the following occurs:
Item | Description |
---|---|
EACCES | In the Q_QUOTAON command, the quota file is not a regular file. |
EACCES | Search permission is denied for a component of a path prefix. |
EFAULT | An invalid Addr parameter is supplied; the associated structure could not be copied in or out of the kernel. |
EFAULT | The Path parameter points outside the process's allocated address space. |
EINVAL | The specified quota control command or quota type is invalid. |
EINVAL | Path name contains a character with the high-order bit set. |
EINVAL | The ID parameter is outside of the supported range of MINDQID through MAXDQID (JFS only). |
EINVAL | The ID parameter is negative or larger than MAXDELIDS when deleting quota entries (JFS2 only). |
EIO | An I/O error occurred while reading or writing the quotas file. |
ELOOP | Too many symbolic links were encountered in translating a path name. |
ENAMETOOLONG | A component of either path name exceeded 255 characters, or the entire length of either path name exceeded 1023 characters. |
ENOENT | A file name does not exist. |
ENOTBLK | Mounted file system is not a block device. |
ENOTDIR | A component of a path prefix is not a directory. |
EOPNOTSUPP | The file system does not support quotas. |
EPERM | The quota control commands is privileged and the caller did not have root user authority. |
EROFS | In the Q_QUOTAON command, the quota file resides on a read-only file system. |
EUSERS | The in-core quota table cannot be expanded (JFS only). |
ENOMEM | Unable to allocate memory. |