setquota(2) — System Calls
NAME
setquota − Enables or disables quotas on a file system
SYNOPSIS
int setquota(
char ∗special,
char ∗file) ;
PARAMETERS
specialPoints to the pathname of the block special device on which a mounted file system exits.
filePoints to the pathname of a file in the file system pointed to by the special parameter from which to take quotas.
DESCRIPTION
The setquota() function enables and disables disk quotas on a file system. The special parameter specifies a block special device on which a mounted file system currently exists. When the file parameter has a positive value, the file in the file system pointed to by special is the one from which to take the quotas. When file has a null value, quotas are disabled on the file system pointed to by special.
The setquota() function fails unless the calling process has superuser privilege.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Upon failure, a value of −1 is returned and errno is set to indicate the error.
ERRORS
If the setquota() function fails, errno may be set to one of the following values:
[ENOTDIR]A component of either path prefix is not a directory.
[EINVAL]Either pathname contains a character with its high-order bit set.
[EINVAL]The kernel has not been compiled with the QUOTA option.
[ENAMETOOLONG]
A component of either pathname exceeded NAME_MAX characters, or the entire length of either pathname exceeds PATH_NAME characters.
[ENODEV]The block special device pointed to by the special parameter does not exist.
[ENOENT]The file pointed to by the file parameter does not exist.
[ELOOP]Too many symbolic links were encountered when translating either pathname.
[EPERM]The caller does not have the appropriate privilege.
[ENOTBLK]The special parameter does not point to a block device.
[ENXIO]The major device number of the block special device pointed to by the special parameter is out of range (this indicates no device driver exists for the associated hardware).
[EROFS]The file pointed to by the file parameter resides on a read-only file system.
[EACCES]Search permission is denied for a component of either path prefix.
[EACCES]The file pointed to by the file parameter resides on a file system different from the one pointed to by the special parameter.
[EACCES]The file pointed to by the file parameter is not a plain file.
[EIO]An I/O error occurred while reading quotas from or writing quotas to the file pointed to by the file parameter.
[EFAULT]The file or special parameter points outside allocated address space accessible by the process.
RELATED INFORMATION
Functions: quotactl(2)