Solaris Containers: Resource Management and Solaris Zones Developer's Guide

Extended Accounting API Functions

The extended accounting API contains functions that perform the following:

exacct System Calls

The following table lists the system calls that interact with the extended accounting subsystem.

Table 3–1 Extended Accounting System Calls

Function 

Description 

putacct(2)

Provides privileged processes with the ability to tag accounting records with additional data that is specific to the process 

getacct(2)

Enables privileged processes to request extended accounting buffers from the kernel for currently executing tasks and processes 

wracct(2)

Requests the kernel to write resource usage data for a specified task or process 

Operations on the exacct File

These functions provide access to the exacct files:

Table 3–2 exacct File Functions

Function 

Description 

ea_open(3EXACCT)

Opens an exacct file.

ea_close(3EXACCT)

Closes an exacct file.

ea_get_object(3EXACCT)

First time use on a group of objects reads data into an ea_object_t structure. Subsequent use on the group cycles through the objects in the group.

ea_write_object(3EXACCT)

Appends the specified object to the open exacct file.

ea_next_object(3EXACCT)

Reads the basic fields (eo_catalog and eo_type) into an ea_object_t structure and rewinds to the head of the record.

ea_previous_object(3EXACCT)

Skips back one object in the exacct file and reads the basic fields (eo_catalog and eo_type) into an ea_object_t.

ea_get_hostname(3EXACCT)

Gets the name of the host on which the exacct file was created.

ea_get_creator(3EXACCT)

Determines the creator of the exacct file.

Operations on exacct Objects

These functions are used to access exacct objects:

Table 3–3 exacct Object Functions

Function 

Description 

ea_set_item(3EXACCT)

Assigns an exacct object and sets the value(s).

ea_set_group(3EXACCT)

Sets the values of a group of exacct objects.

ea_match_object_catalog(3EXACCT)

Checks an exacct object's mask to see if that object has a specific catalog tag.

ea_attach_to_object(3EXACCT)

Attaches an exacct object to a specified exacct object.

ea_attach_to_group(3EXACCT)

Attaches a chain of exacct objects as member items of a specified group.

ea_free_item(3EXACCT)

Frees the value fields in the specified exacct object.

ea_free_object(3EXACCT)

Frees the specified exacct object and any attached hierarchies of objects.

Miscellaneous Operations

These functions are associated with miscellaneous operations:

ea_error(3EXACCT)

ea_match_object_catalog(3EXACCT)