chprojattr Subroutine

Purpose

Updates and modifies the project attributes in kernel project registry for the given project.

Library

The libaacct.a library.

Syntax

<sys/aacct.h>

chprojattr(struct project *, int cmd)

Description

The chprojattr subroutine alters the attributes of a project defined in the kernel project registry. A pointer to struct project containing the project definition and the operation command is sent as input arguments. The following operations are permitted:
  • PROJ_ENABLE_AGGR - Enables aggregation for the specified project
  • PROJ_DISABLE_AGGR - Disables aggregation for the specified project

If PROJ_ENABLE_AGGR is passed, then the aggregation status bit is set to 1. If PROJ_DISABLE_AGGR is passed, then the aggregation status bit set to 0.

Note: To initialize the project structure, the user must call the getprojdef subroutine before calling the chprojattr subroutine.

Parameters

Item Description
project Pointer containing the project definition.
cmd An integer command indicating whether to perform a set or clear operation.

Security

Only for privileged users. Privilege can be extended to nonroot users by granting the CAP_AACCT capability to a user.

Return Values

Item Description
0 Success
-1 Failure

Error Codes

Item Description
EINVAL Invalid arguments passed. The passed command flag is invalid or the passed pointer is NULL.
ENONENT Project not found.