posix_trace_attr_getinherited Subroutine

Purpose

Retrieves the inheritance policy of a trace stream.

Library

Posix Trace Library (libposixtrace.a)

Syntax

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

Description

The posix_trace_attr_getinherited subroutine gets the inheritance policy stored in the inheritance attribute of the attr object for traced processes across the fork and posix_spawn subroutine. The inheritance 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_CLOSE_FOR_CHILD After a fork or spawn operation, the child is not traced, and tracing of the parent continues.
POSIX_TRACE_INHERITED After a fork or spawn operation, if the parent is being traced, its child will be simultaneously traced using the same trace stream.

The default value for of the inheritance attribute is POSIX_TRACE_CLOSE_FOR_CHILD.

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.
inheritancepolicy Specifies where the inheritance attribute of the attr object is stored.

Return Values

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

If successful, the posix_trace_attr_getinherited subroutine stores the value of the attr object in the object specified by the inheritancepolicy parameter. Otherwise, the content of this object is not modified.

Errors

This 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 the AIX® Version 7.1 Files Reference