buildproclist Subroutine

Purpose

Retrieves a list of process transaction records based on the criteria specified.

Library

The libaacct.a library.

Syntax

#define <sys/aacct.h>
int buildproclist(crit, crit_list, n_crit, p_list, sublist)
int crit;
union proc_crit *crit_list;
int n_crit;
struct aacct_tran_rec *p_list;
struct aacct_tran_rec **sublist;

Description

The buildproclist subroutine retrieves a subset of process transaction records from the master process transaction records that are given as input based on the selection criteria provided. This selection criteria can be one of the following values defined in sys/aacct.h:
  • CRIT_UID
  • CRIT_GID
  • CRIT_PROJ
  • CRIT_CMD
For example, if the criteria is specified as CRIT_UID, the list of process transaction records for specific user IDs will be retrieved. The list of user IDs are passed through the crit_list argument of type union proc_crit. Based on the specified criteria, the caller has to pass an array of user IDs, group IDs, project IDs or command names in this union.

Usually, the master list of transaction records is obtained by a prior call to the getproclist subroutine.

Parameters

Item Description
crit Integer value representing the selection criteria for the process records.
crit_list Pointer to union proc_crit where the data for the selection criteria is passed.
n_crit Number of elements to be considered for the selection, such as the number of user IDs.
p_list Master list of process transaction records.
sublist Pointer to the linked list of aacct_tran_rec structures, which hold the retrieved process transaction records.

Security

No restrictions. Any user can call this function.

Return Values

Item Description
0 The call to the subroutine was successful.
-1 The call to the subroutine failed.

Error Codes

Item Description
EINVAL The passed pointer is NULL.
ENOMEM Insufficient memory.
EPERM Permission denied. Unable to read the data file.