Sun::Solaris::Exacct::Catalog Module
The Sun::Solaris::Exacct::Catalog module provides a wrapper around the 32-bit integer used as a catalog tag. The catalog tag is represented as a Perl object blessed into the Sun::Solaris::Exacct::Catalog class. Methods can be used to manipulate fields in a catalog tag.
Sun::Solaris::Exacct::Catalog Constants
All the EXT_*, EXC_* and EXD_* macros are extracted during the module build process from the /usr/include/sys/exact_catalog.h file and are provided as constants. Constants passed to the Sun::Solaris::Exacct::Catalog methods can either be an integer value, such as EXT_UINT8, or the string representation of the same variable, such as "EXT_UINT8".
Sun::Solaris::Exacct::Catalog Functions, Class Methods, and Object Methods
The Perl extensions to the libexacct(3LIB) API provide the following class methods forSun::Solaris::Exacct::Catalog. Exacct(3PERL) andExacct::Catalog(3PERL)
register |
new |
The Perl extensions to the libexacct(3LIB) API provide the following object methods for Sun::Solaris::Exacct::Catalog.
value |
type |
catalog |
id |
type_str |
catalog_str |
id_str |
Sun::Solaris::Exacct::Catalog Exports
By default, nothing is exported from this module. The following tags can be used to selectively import constants and functions defined in this module.
Tag | Constant or Function |
---|---|
:CONSTANTS | EXT_*, EXC_* and EXD_*. |
:ALL | :CONSTANTS |
Additionally, any constants defined with the register() function can optionally be exported into the caller's package.
Sun::Solaris::Exacct::File Module
The Sun::Solaris::Exacct::File module provides wrappers for the exacct functions that manipulate accounting files. The interface is object-oriented, and allows the creation and reading of exacct files. The C library calls that are wrapped by this module are:
ea_open(3EXACCT) |
ea_close(3EXACCT) |
ea_next_object(3EXACCT) |
ea_previous_object(3EXACCT) |
ea_write_object(3EXACCT) |
ea_get_object(3EXACCT) |
ea_get_creator(3EXACCT) |
ea_get_hostname(3EXACCT) |
The file read and write methods operate on Sun::Solaris::Exacct::Object objects. These methods perform all the necessary memory management, packing, unpacking and structure conversions that are required.
Sun::Solaris::Exacct::File Constants
Sun::Solaris::Exacct::File provides the EO_HEAD, EO_TAIL, EO_NO_VALID_HDR, EO_POSN_MSK and EO_VALIDATE_MSK constants. Other constants that are needed by the new() method are in the standard Perl Fcntl module. Table 4-2 describes the action of new() for various values of $oflags and $aflags.
Sun::Solaris::Exacct::File Functions, Class Methods, and Object Methods
The Sun::Solaris::Exacct::File module has no functions.
The Perl extensions to the libexacct(3LIB) API provide the following class method forSun::Solaris::Exacct::File.
new |
The following table describes the new() action for combinations of the $oflags and $aflags parameters.
Table 4-2 $oflags and $aflags Parameters
$oflags | $aflags | Action |
---|---|---|
O_RDONLY | Absent or EO_HEAD | Open for reading at the start of the file. |
O_RDONLY | EO_TAIL | Open for reading at the end of the file. |
O_WRONLY | Ignored | File must exist, open for writing at the end of the file. |
O_WRONLY | O_CREAT | Ignored | Create file if the file does not exist. Otherwise, truncate, and open for writing. |
O_RDWR | Ignored | File must exist, open for reading or writing, at the end of the file. |
O_RDWR | O_CREAT | Ignored | Create file if the file does not exist. Otherwise, truncate, and open for reading or writing. |
Note - The only valid values for $oflags are the combinations of O_RDONLY, O_WRONLY, O_RDWR or O_CREAT. $aflags describes the required positioning in the file for O_RDONLY. Either EO_HEAD or EO_TAIL are allowed. If absent, EO_HEAD is assumed.
The perl extensions to the libexacct(3LIB) API provide the following object methods forSun::Solaris::Exacct::File.
creator |
hostname |
next |
previous |
get |
write |
Note - Close a Sun::Solaris::Exacct::File. There is no explicit close() method for a Sun::Solaris::Exacct::File. The file is closed when the filehandle object is undefined or reassigned.
Sun::Solaris::Exacct::File Exports
By default, nothing is exported from this module. The following tags can be used to selectively import constants that are defined in this module.
Tag | Constant or Function |
---|---|
:CONSTANTS | EO_HEAD, EO_TAIL, EO_NO_VALID_HDR, EO_POSN_MSK, EO_VALIDATE_MSK. |
:ALL | :CONSTANTS and Fcntl(:DEFAULT). |
Sun::Solaris::Exacct::Object Module
The Sun::Solaris::Exacct::Object module serves as a parent of the two possible types of exacct objects: Items and Groups. An exacct Item is a single data value, an embedded exacct object, or a block of raw data. An example of a single data value is the number of seconds of user CPU time consumed by a process. An exacct Group is an ordered collection of exacct Items such as all of the resource usage values for a particular process or task. If Groups need to be nested within each other, the inner Groups can be stored as embedded exacct objects inside the enclosing Group.
The Sun::Solaris::Exacct::Object module contains methods that are common to both exacct Items and Groups. Note that the attributes of Sun::Solaris::Exacct::Object and all classes derived from it are read-only after initial creation via new(). The attributes made read-only prevents the inadvertent modification of the attributes which could give rise to inconsistent catalog tags and data values. The only exception to the read-only attributes is the array used to store the Items inside a Group object. This array can be modified using the normal perl array operators.
Sun::Solaris::Exacct::Object Constants
Sun::Solaris::Exacct::Object provides the EO_ERROR, EO_NONE, EO_ITEM and EO_GROUP constants.
Sun::Solaris::Exacct::Object Functions, Class Methods, and Object Methods
The Sun::Solaris::Exacct::Object module has no functions.
The Perl extensions to the libexacct(3LIB) API provide the following class method forSun::Solaris::Exacct::Object.
dump |
The Perl extensions to the libexacct(3LIB) API provide the following object methods forSun::Solaris::Exacct::Object.
type |
catalog |
match_catalog |
value |
Sun::Solaris::Exacct::Object Exports
By default, nothing is exported from this module. The following tags can be used to selectively import constants and functions defined in this module.
Tag | Constant or Function |
---|---|
:CONSTANTS | EO_ERROR, EO_NONE, EO_ITEM and EO_GROUP |
:ALL | :CONSTANTS |