posix_trace_attr_setlogsize Subroutine

Purpose

Sets the size of the log of a trace stream.

Library

Posix Trace Library (libposixtrace.a)

Syntax

#include <sys/types.h>
#include <trace.h>

int posix_trace_attr_setlogsize(attr, logsize)
const trace_attr_t *restrict attr;
size_t *restrict logsize;

Description

The posix_trace_attr_setlogsize subroutine sets the maximum allowed size in bytes in the log-max-size attribute of the attr object, using the size value specified by the logsize parameter. If the logsize parameter is too small regarding the stream size, the posix_trace_attr_setlogsize subroutine does not fail. It sets the log-max-size attribute in order to be able to write at least one stream in the log file. Further calls to the posix_trace_create or posix_trace_create_withlog subroutines with such an attributes object will not fail.

The size of the trace log is used if the log-full-policy attribute of the attr object is set to the POSIX_TRACE_LOOP value or the POSIX_TRACE_UNTIL_FULL value. If the attr object is set to the POSIX_TRACE_APPEND value. The system ignores the log-max-size attribute in this case.

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 attributes object.
logsize Specifies where the log-max-size attribute, in bytes, will be attained.

Return Values

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

Errors

This 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 and the types.h file in AIX® Version 7.1 Files Reference