dg_set_cpd_limits(2) SDK R4.11 dg_set_cpd_limits(2)
NAME
dgsetcpdlimits - change the resource limits of a control point
directory
SYNOPSIS
#include <sys/dgcpd.h>
int dgsetcpdlimits (path, blocks, filenodes)
char * path;
unsigned long blocks;
unsigned long filenodes;
where:
path Pathname of the CPD to be changed
blocks New block allocation ceiling
filenodes New file node allocation ceiling
DESCRIPTION
The dgsetcpdlimits system call changes the limits associated with
a control point directory. The path parameter points to a pathname
naming a control point directory (terminal symbolic links are
followed in path). If the calling process has the appropriate access
to path (see below), the CPD limits of path are set to blocks disk
blocks and filenodes file nodes. The new CPD limits will be visible
in subsequent dgstat calls on path: the maxcpdblocks field will be
blocks and the maxcpdfilenodes field will be filenodes.
The effects of a CPD's limits on its space descendants (those files
and directories which are below path and not across a file system
mount point boundary from it) are as follows: If the current number
of disk blocks used by path and all its space descendants equals or
exceeds blocks, all attempts to allocate blocks to path or one of its
space descendants will fail with the error ENOSPC. Likewise, if the
total number of file nodes used by path and all its space descendants
equals or exceeds filenodes, all attempts to allocate more file
nodes below path will fail with the error ENOSPC. The only exception
to these rules is that the calling process with appropriate privilege
may override the CPD limits of the root directory of a file system
(which is always a CPD), though obviously not in excess of the actual
physical resources in the file system. For systems supporting the
DG/UX Capability Option, appropriate privilege is defined as having
one or more specific capabilities enabled in the effective capability
set of the calling process. See capdefaults(5) for the default
capability for this system call.
On systems without the DG/UX Capability Option, appropriate privilege
means that the process has an effective UID of root. See the
appropriateprivilege(5) man page for more information.
The blocks parameter can be set to any number between 0 and
DG_CPD_NO_BLOCK_LIMIT, inclusive. Likewise, the filenodes parameter
can be set to any number between 0 and DG_CPD_NO_FILE_NODE_LIMIT,
inclusive. Note that it is not required that blocks be greater than
the current number of blocks in use by path and its space
descendants, or that filenodes be greater than the current number of
file nodes in use by path and its space descendants.
The last component of path may not be "." or "..". Use an absolute
pathname instead.
ACCESS CONTROL
The calling process must have write access to the parent directory of
path, unless path is the root of a file system. In that case, only a
calling process with appropriate privilege may make this call.
The process must have permission to resolve path .
RETURN VALUE
0 The limits of the control-point directory path were
successfully modified.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EINVAL The named file path exists but it is not a control
point directory; or the blocks parameter is not in the
range 0 to DG_CPD_NO_BLOCK_LIMIT; or the filenodes
parameter is not in the range 0 to
DG_CPD_NO_FILE_NODE_LIMIT; or the last component of
the path is "." or "..".
ENOTSUPPORTED The operation is not supported because the referenced
file is an NFS file.
EPERM The CPD denoted by path is the root of a file system,
and the calling process does not have appropriate
privilege.
EACCES The CPD denoted by path is not the root of a file
system, and the process does not have write permission
in the parent directory of path.
EROFS The named file resides on a file system device mounted
read-only.
ENOENT The file the pathname resolved to does not exist.
ENOENT A non-terminal component of the pathname does not
exist.
ENOTDIR A non-terminal component of the pathname was not a
directory or symbolic link.
ENAMETOOLONG The pathname exceeds the length limit for pathnames.
ENAMETOOLONG A component of the pathname exceeds the length limit
for filenames.
ENOMEM There are not enough system resources to resolve the
pathname or to expand a symbolic link.
ELOOP The number of symbolic links encountered during
pathname resolution exceeded MAXSYMLINKS. A symbolic
link cycle is suspected.
EPERM The pathname contains a character not in the allowed
character set.
EFAULT The pathname does not completely reside in the
process's address space or the pathname does not
terminate in the process's address space.
EACCES The calling process does not have permission to
resolve the pathname.
SEE ALSO
mkdir(1), rmdir(1), dgmknod(2), rmdir(2), appropriateprivilege(5),
dgstat(5). capdefaults(5).
Licensed material--property of copyright holder(s)