posix_trace_attr_getlogfullpolicy Subroutine

Purpose

Retrieves the log full policy of a trace stream.

Library

Posix Trace Library (libposixtrace.a)

Syntax

#include <trace.h>
int posix_trace_attr_getlogfullpolicy(attr,logpolicy)
const trace_attr_t *restrict;
int *restrict logpolicy;

Description

The posix_trace_attr_getlogfullpolicy subroutine gets the trace log full policy stored in the log-full-policy attribute of the attr object. The attr object points to the attribute object to get log full policy.

The log-full-policy attribute of the attr object is set to one of the following values defined by manifest constants in the trace.h header file:
Item Description
POSIX_TRACE_LOOP The trace log loops until the associated trace stream is stopped. When the trace log gets full, the file system reuses the resources allocated to the oldest trace events that were recorded. In this way, the trace log always contains the most recent trace events that are flushed.
POSIX_TRACE_UNTIL_FULL The trace stream is flushed to the trace log until the trace log is full. This condition can be deduced from the posix_log_full_status member status (see the posix_trace_status_info structure defined in the trace.h header file). The last recorded trace event is the POSIX_TRACE_STOP trace event.
POSIX_TRACE_APPEND The associated trace stream is flushed to the trace log without log size limitation. If the application specifies the POSIX_TRACE_APPEND value, the log-max-size attribute is ignored.

The default value for the log-full-policy attribute is POSIX_TRACE_LOOP.

If this subroutine is called with a non-initialized attributes object as parameter, the result is not specified.

Parameters

Item Description
attr Specifies the trace attribute object.
logpolicy Specifies where the log-full-policy attribute of the attr parameter is attained or stored.

Return Values

Upon successful completion, it returns a value of zero. Otherwise, it returns the corresponding error number.

If successful, the posix_trace_attr_getlogfullpolicy subroutine stores the value of the log-full-policy attribute in the object specified by the logpolicy parameter. Otherwise, the content of this object is not modified.

Errors

The posix_trace_attr_getlogfullpolicy subroutine fails if the following error number returns:
Item Description
EINVAL The object of a parameter is null or not valid.

Files

The trace.h file in Files Reference