Go to main content

Resource Management and Oracle® Solaris Zones Developer's Guide

Exit Print View

Updated: February 2021
 
 

Programming Issues With exacct Files

  • Note the following issues related to memory management:

    • Use the same allocation flags for the ea_free_object and ea_unpack_object functions.

    • For string objects, the ea_set_item function results in allocation, and should be followed by ea_free_item(obj, EUP_ALLOC) to free internal storage.

    • The ea_pack_object and getacct functions use zero size. To get size, the getacct function should be called twice: first time with NULL buffer to size buffer to be passed in the second call. See Example 5, Reading and Displaying the Contents of a System exacct File.

  • In order to be robust in the face of changes to exacct file content, applications should skip unknown exacct records in exacct files produced by the system.

  • Use EXC_LOCAL for customized accounting to create application-specific records. Use the libexacct extended accounting library as general tracing or debugging facility.

    • See <sys/exacct_catalog.h>.

    • You can customize the data id field of ea_catalog_t.