QUOTA_READ(2) SysV QUOTA_READ(2)
NAME
quota_read - Read sequentially (one by one) entries from the disk quota
table
SYNOPSIS
#include <apollo/sys/swap.h>
int quota_read (special, handle, uid, current, maxquota, done)
char *special;
quota_handle_t handle;
uid_$t *uid;
unsigned int *current;
unsigned int *maxquota;
int *done;
DESCRIPTION
Entries in the the disk quota table are read with the quota_read system
call. Associated with each logical volume configured with quotas is a
table of users allowed to create or grow files on that volume and the
maximum number of disk blocks that they are allowed to "own."
The special argument specifies a block special device which must be
mounted on the local node as a file system.
Each time you call quota_read, it returns information for one entry in
the quota table. Prior to the first call, handle[0] should be
initialized to 0. The call returns a non-zero value on an error.
When the quota table has been exhsusted, done is set to -1. Otherwise,
the call returns the following:
uid identifies the user within the Domain/OS registry who "owns"
the quota specifed in this entry.
maxquota is the maximum amount of disk space (in 1024-byte units) that
the user is allowed.
current indicates the amount of 1024 bytes units of disk space
currently charged against the user.
The quota table must exist; you create a quota table, with the invol
utility.
EXAMPLE
Following is an example of how quota_read it is used:
handle[0] = 0;
for ( ; ; )
if (quota_read(specdev, handle, &uid, ¤t, &maxquota, &done) < 0) {
/* <Handle Error> */
}
/* reached end of table? */
if (done == -1) break;
/* ... maxquota, current for user uid
you can use rgyc_$ calls to convert uid to either a name or unix-id
*/
}
NOTE
Only a superuser may read entries from the the disk quota table.
RETURN VALUE
On successful completion of quota_read, a zero value is returned; non-
zero means failure.
ERRORS
On failure, quota_read returns one of the following values.
[EACCES] Search permission is denied for a component of the path
prefix.
[EIO] An I/O error occurred while opening the block special
device.
[ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an
entire pathname exceeded 1023 characters.
[ENOENT] The named device does not exist.
[ENOTBLK] special is not a block device.
[ENOTDIR] A component of the path prefix is not a directory.
[ENXIO] The major device number of special is out of range (this
indicates no device driver exists for the associated
hardware).
[EIO] An I/O error occurred while opening the block special
device. [EPERM] The caller is not the super-user.
SEE ALSO
quota_ctl(2), quota_add(2) quotaon(1m), quotaoff(1m), edquota(1m),
invol(1m)