posix_trace_attr_setname Subroutine

Purpose

Sets the trace name.

Library

Posix Trace Library (libposixtrace.a)

Syntax

#include <trace.h>

int posix_trace_attr_setname(attr, tracename) 
trace_attr_t *attr;
const char *tracename;

Description

The posix_trace_attr_setname subroutine sets the name in the trace-name attribute of the attr object with the string pointed to by the tracename parameter. If the length of the string name exceeds the value of the TRACE_NAME_MAX characters, the name copied into the attr object will be truncated to one that is less than the length of the TRACE_NAME_MAX characters (see limits.h File). The default value is a null string.

If the posix_trace_attr_setname 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.
tracename Specifies where the trace-name attribute is attained.

Return Values

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

Errors

The posix_trace_attr_setname subroutine fails if the following error number returns:
Item Description
EINVAL One of the parameters is null.

Files

The trace.h and the limits.h files in AIX® Version 7.1 Files Reference