Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

quotaon(8)

quotacheck(8)

QUOTACTL(2)  —  SYSTEM CALLS

NAME

quotactl − manipulate disk quotas

SYNOPSIS

#include <ufs/quota.h>

quotactl(cmd, special, uid, addr)
int cmd;
char ∗special;
int uid;
caddr_t addr;

DESCRIPTION

The quotactl call manipulates disk quotas.  The cmd parameter indicates a command to be applied to the user ID uid. 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.  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 given with each command below. 

Q_QUOTAON
Turn on quotas for a file system. Addr is a pointer to a null terminated string containing the path name of file containing the quotas for the file system.  The quota file must exist; it is normally created with the quotacheck(8) program.  This call is restricted to the super-user.

Q_QUOTAOFF
Turn off quotas for a file system. This call is restricted to the super-user.

Q_GETQUOTA
Get disk quota limits and current usage for user uid. Addr is a pointer to a struct dqblk structure (defined in <ufs/quota.h>). Only the super-user may get the quotas of a user other than himself.

Q_SETQUOTA
Set disk quota limits and current usage for user uid. Addr is a pointer to a struct dqblk structure (defined in <ufs/quota.h>). This call is restricted to the super-user.

Q_SETQLIM
Set disk quota limits for user uid. Addr is a pointer to a struct dqblk structure (defined in <ufs/quota.h>). This call is restricted to the super-user.

Q_SYNC
Update the on-disk copy of quota usages. This call is restricted to the super-user.

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

A quotactl call will fail when one of the following occurs:

EINVAL Cmd is invalid. 

EPERM The call is privileged and the caller was not the super-user. 

EINVAL The special parameter is not a mounted file system or is a mounted file system without quotas enabled. 

ENOTBLK The special parameter is not a block device. 

EFAULT An invalid addr is supplied; the associated structure could not be copied in or out of the kernel. 

EINVAL The addr parameter is being interpreted as the path of a quota file which exists but is either not a regular file or is not on the file system pointed to by the special parameter. 

EUSERS The quota table is full. 

SEE ALSO

quotaon(8), quotacheck(8)

BUGS

There should be some way to integrate this call with the resource limit interface provided by setrlimit(2) and getrlimit(2). Incompatible with Melbourne quotas.

Sun Release 3.2  —  Last change: 20 August 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026