HPlogo HP-UX Reference Volume 3 of 5 > q

quotactl(2)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

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 normally 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 appropriate privileges can get the quotas of a user other than himself.

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_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_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 indicate the error.

ERRORS

quotactl() fails when any of the following occurs:

[ENOSYS]

The kernel has not been configured with the disk quota subsystem.

[EINVAL]

The parameters cmd and/or uid are invalid.

[ESRCH]

No disc quota is found for the indicated user or quotas have not been turned on for this file system.

[EPERM]

The call is privileged and the calling process does not have appropriate privileges.

[ENODEV]

The parameter special contains a type of file system that does not support quotas. Currently, quotas are supported on HFS and VxFS file systems.

[ENOTBLK]

The parameter special is not a block device.

[EACCES]

(Q_QUOTAON) The quota file pointed to by addr exists but is either not a regular file or is not on the file system pointed to by special.

[EBUSY]

Q_QUOTAON attempted while another Q_QUOTAON or Q_QUOTAOFF is in progress.

[ENOENT]

The file specified by special or addr does not exist.

[EFAULT]

The addr or special parameter points to an invalid address. Reliable detection of this error is implementation-dependent.

[EDQUOT]

User's disk quota block limit has been reached for this file system.

WARNINGS

The quotactl() system call is incompatible with the 4.2/4.3BSD implementation of Melbourne quotas which uses a different system call interface and on-disk data structure.

AUTHOR

quotactl() was developed by HP and Sun Microsystems, Inc.

© Hewlett-Packard Development Company, L.P.