posix_trace_attr_setinherited Subroutines

Purpose

Sets the inheritance policy of a trace stream.

Library

Posix Trace Library (libposixtrace.a)

Syntax

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

Description

The posix_trace_attr_setinherited subroutine sets 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 the attr object 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 trace attributes object.
inheritancepolicy Specifies where the inheritance attribute is 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 in the AIX® Version 7.1 Files Reference.