trc_free Subroutine

Purpose

Frees memory allocated by the trc_read, trc_find, trc_loginfo, or trc_hookname subroutine.

Library

libtrace.a

Syntax

#include <sys/libtrace.h>

int trc_free (parmp)
void *parmp;

Description

The trc_free subroutine is used to free memory associated with data structures returned by the trace retrieval API. It does not free the storage for the base structure, however, only storage allocated by the API on behalf of the user. The pointer must point to one of the following:
trc_read_t
Data returned by the trc_read or trc_find subroutine.
trc_loginfo_t
Data returned by the trc_loginfo subroutine.
trc_hookname_t
Data returned by the trc_hookname subroutine.
trc_logpos_t
A log position object returned by the trc_tell subroutine.

A log handle, trc_loghandle_t, must be freed using the trc_close subroutine.

For example, trc_free(&trc_data), where trc_data is of type trc_read_t, frees the storage referenced by the trc_data structure, but does not free trc_data since it must be pre-allocated by the user.

Parameters

Item Description
parmp Points to a structure as described above.

Return Values

Upon successful completion, the trc_free subroutine returns 0.

Error Codes

Item Description
EINVAL The parmp parameter points to an unsupported data type.