posix_trace_attr_setlogfullpolicy Subroutine

Purpose

Sets the log full policy of a trace stream.

Library

Posix Trace Library (libposixtrace.a)

Syntax

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

Description

The posix_trace_attr_setlogfullpolicy subroutine sets the trace log full policy stored in log-full-policy attribute of the attr object. The attr parameter points to the attribute object to get log full policy.

The log-full-policy attribute of the attr parameter 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 the subroutine is called with a non-initialized attributes object as parameter, the result is not specified.

Parameters

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

Return Values

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

Errors

The subroutine fails if the following error number returns:
Item Description
EINVAL The attr parameter is null or the other parameter is not valid.

Files

The trace.h file in AIX® Version 7.1 Files Reference