HP-UX Reference (11i v2 07/12) - 2 System Calls (vol 5)

q
quotactl(2) quotactl(2)
NAME
quotactl() - manipulate disk quotas
SYNOPSIS
#include <sys/quota.h>
int quotactl(int cmd, const char *special, uid_t uid, void *addr);
DESCRIPTION
quotactl() manipulates disk quotas. cmd indicates a command to be applied to the user ID uid.
Parameter special is a pointer to a null-terminated string containing the path name of the block special
device for the file system being manipulated. The block special device must be mounted. The parameter
addr is the address of an optional, command-specific, data structure which is copied in or out of the system.
The interpretation of addr is explained with each command below:
Q_QUOTAON Turn on quotas for a file system. The parameter addr points to the path name of
file containing the quotas for the file system. The quota file must exist; it is nor-
mally created using the
quotacheck command (see quotacheck(1M)). The uid
parameter is ignored. This call is restricted to users having appropriate
privileges.
Q_QUOTAOFF Turn off quotas for a file system. The addr and uid parameters are ignored.
This call is restricted to the user with appropriate privileges.
Q_GETQUOTA Get disk quota limits and current usage for user uid. addr is a pointer to a
dqblk structure (defined in <sys/quota.h>
). Only users having appropri-
ate privileges can get the quotas of a user other than himself.
Q_GETQUOTA64 Get 64-bit disk quota limits and current usage for user uid. addr is a pointer to
a
dqblk64 structure (defined in <sys/quota.h>
). Only users having
appropriate privileges can get the quotas of a user other than himself. VxFS 3.5
will only track usage for dqb64_curblocks up to to 2 TB.
Q_SETQUOTA Set disk quota limits and current usage of files and blocks for user uid. Note
vxfs does not allow the current usage fields to be changed. addr is a pointer to
a dqblk structure (defined in <sys/quota.h>
). This call is restricted to
users with appropriate privileges.
Q_SETQUOTA64 Set 64-bit disk quota limits and current usage of files and blocks for user uid.
Note
vxfs does not allow the current usage fields to be changed. addr is a
pointer to a
dqblk64 structure (defined in <sys/quota.h>
). This call is
restricted to users with the appropriate privileges.
Q_SETQLIM Set disk quota limits for user uid. The parameter addr is a pointer to a
dqblk
structure (defined in <sys/quota.h>
). This call is restricted to users with
appropriate privileges.
Q_SETQLIM64 Set 64-bit disk quota limits for user uid. The parameter addr is a pointer to a
dqblk64 structure (defined in <sys/quota.h>
). This call is restricted to
users with the appropriate privileges.
Q_QUOTAINFO Retrieve information about quotas supported by file system uid. The parameter
addr is a pointer to a uint64_t flags word. The meanings of the various bit
fields are defined in <sys/quota.h>.
Q_SYNC Update the on-disk copy of quota usages for a file system. If special is null, all
file systems with active quotas are synced. The parameters addr and uid are
ignored.
RETURN VALUE
Upon successful completion, quotactl() returns 0. Otherwise, it returns -1 and sets errno to indi-
cate the error.
ERRORS
quotactl() fails when any of the following occurs:
[ENOSYS] The kernel has not been configured with the disk quota subsystem.
310 Hewlett-Packard Company 1 HP-UX 11i Version 2: December 2007 Update