# posix_trace_attr_getinherited

## PROLOG



           This manual page is part of the POSIX Programmer's Manual.  The
           Linux implementation of this interface may differ (consult the
           corresponding Linux manual page for details of Linux behavior), or
           the interface may not be implemented on Linux.
    


## NAME



           posix_trace_attr_getinherited, posix_trace_attr_getlogfullpolicy,
           posix_trace_attr_getstreamfullpolicy,
           posix_trace_attr_setinherited, posix_trace_attr_setlogfullpolicy,
           posix_trace_attr_setstreamfullpolicy — retrieve and set the
           behavior of a trace stream (**TRACING**)
    


## SYNOPSIS



           #include <trace.h>
    
           int posix_trace_attr_getinherited(const trace_attr_t *restrict _attr_ ,
               int *restrict _inheritancepolicy_);
           int posix_trace_attr_getlogfullpolicy(const trace_attr_t *restrict _attr_ ,
               int *restrict _logpolicy_);
           int posix_trace_attr_getstreamfullpolicy(const trace_attr_t *restrict
               _attr_ , int *restrict _streampolicy_);
           int posix_trace_attr_setinherited(trace_attr_t *_attr_ ,
               int _inheritancepolicy_);
           int posix_trace_attr_setlogfullpolicy(trace_attr_t *_attr_ ,
               int _logpolicy_);
           int posix_trace_attr_setstreamfullpolicy(trace_attr_t *_attr_ ,
               int _streampolicy_);
    


## DESCRIPTION



           The               _posix_trace_attr_getinherited_()              and
           _posix_trace_attr_setinherited_() functions, respectively, shall get
           and set the inheritance policy stored in the _inheritance_ attribute
           for traced processes across the _fork_() and _spawn_() operations. The
           _inheritance_ attribute of the attributes object pointed to  by  the
           _attr_  argument shall be set to one of the following values defined
           by manifest constants in the _< trace.h>_ header:
    
           POSIX_TRACE_CLOSE_FOR_CHILD
                 After a _fork_() or _spawn_() operation, the child shall not be
                 traced, and tracing of the parent shall continue.
    
           POSIX_TRACE_INHERITED
                 After a _fork_() or _spawn_() operation, if the parent is being
                 traced, its child shall be concurrently traced using the
                 same trace stream.
    
           The default value for the _inheritance_ attribute is
           POSIX_TRACE_CLOSE_FOR_CHILD.
    
           The _posix_trace_attr_getlogfullpolicy_() and
           _posix_trace_attr_setlogfullpolicy_() functions, respectively, shall
           get and set the trace log full policy stored in the _log-full-_
           _policy_ attribute of the attributes object pointed to by the _attr_
           argument.
    
           The _log-full-policy_ attribute shall be set to one of the following
           values defined by manifest constants in the _< trace.h>_ header:
    
           POSIX_TRACE_LOOP
                 The trace log shall loop until the associated trace stream
                 is stopped.  This policy means that when the trace log gets
                 full, the file system shall reuse the resources allocated to
                 the oldest trace events that were recorded. In this way, the
                 trace log will always contain the most recent trace events
                 flushed.
    
           POSIX_TRACE_UNTIL_FULL
                 The trace stream shall be 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 _< trace.h>_).
                 The last recorded trace event shall be the POSIX_TRACE_STOP
                 trace event.
    
           POSIX_TRACE_APPEND
                 The associated trace stream shall be flushed to the trace
                 log without log size limitation. If the application
                 specifies POSIX_TRACE_APPEND, the implementation shall
                 ignore the _log-max-size_ attribute.
    
           The default value for the _log-full-policy_ attribute is
           POSIX_TRACE_LOOP.
    
           The _posix_trace_attr_getstreamfullpolicy_() and
           _posix_trace_attr_setstreamfullpolicy_() functions, respectively,
           shall get and set the trace stream full policy stored in the
           _stream-full-policy_ attribute of the attributes object pointed to
           by the _attr_ argument.
    
           The _stream-full-policy_ attribute shall be set to one of the
           following values defined by manifest constants in the _< trace.h>_
           header:
    
           POSIX_TRACE_LOOP
                 The trace stream shall loop until explicitly stopped by the
                 _posix_trace_stop_() function. This policy means that when the
                 trace stream is full, the trace system shall reuse the
                 resources allocated to the oldest trace events recorded. In
                 this way, the trace stream will always contain the most
                 recent trace events recorded.
    
           POSIX_TRACE_UNTIL_FULL
                 The trace stream will run until the trace stream resources
                 are exhausted. Then the trace stream will stop. This
                 condition can be deduced from _posix_stream_status_ and
                 _posix_stream_full_status_ (see the **posix_trace_status_info**
                 structure defined in _< trace.h>_).  When this trace stream is
                 read, a POSIX_TRACE_STOP trace event shall be reported after
                 reporting the last recorded trace event.  The trace system
                 shall reuse the resources allocated to any trace events
                 already reported—see the _posix_trace_getnext_event_(),
                 _posix_trace_trygetnext_event_(), and
                 _posix_trace_timedgetnext_event_() functions—or already
                 flushed for an active trace stream with log if the Trace Log
                 option is supported; see the _posix_trace_flush_() function.
                 The trace system shall restart the trace stream when it is
                 empty and may restart it sooner. A POSIX_TRACE_START trace
                 event shall be reported before reporting the next recorded
                 trace event.
    
           POSIX_TRACE_FLUSH
                 If the Trace Log option is supported, this policy is
                 identical to the POSIX_TRACE_UNTIL_FULL trace stream full
                 policy except that the trace stream shall be flushed
                 regularly as if _posix_trace_flush_() had been explicitly
                 called. Defining this policy for an active trace stream
                 without log shall be invalid.
    
           The default value for the _stream-full-policy_ attribute shall be
           POSIX_TRACE_LOOP for an active trace stream without log.
    
           If the Trace Log option is supported, the default value for the
           _stream-full-policy_ attribute shall be POSIX_TRACE_FLUSH for an
           active trace stream with log.
    


## RETURN VALUE



           Upon successful completion, these functions shall return a value
           of zero. Otherwise, they shall return the corresponding error
           number.
    
           If successful, the _posix_trace_attr_getinherited_() function shall
           store the _inheritance_ attribute value in the object pointed to by
           _inheritancepolicy_.  Otherwise, the content of this object is
           undefined.
    
           If successful, the _posix_trace_attr_getlogfullpolicy_() function
           shall store the _log-full-policy_ attribute value in the object
           pointed to by _logpolicy_.  Otherwise, the content of this object is
           undefined.
    
           If successful, the _posix_trace_attr_getstreamfullpolicy_() function
           shall store the _stream-full-policy_ attribute value in the object
           pointed to by _streampolicy_.  Otherwise, the content of this object
           is undefined.
    


## ERRORS



           These functions may fail if:
    
           **EINVAL** The value specified by at least one of the arguments is
                  invalid.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           None.
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           The following functions:
    
                  _posix_trace_attr_getinherited_()
                  _posix_trace_attr_getlogfullpolicy_()
                  _posix_trace_attr_getstreamfullpolicy_()
                  _posix_trace_attr_setinherited_()
                  _posix_trace_attr_setlogfullpolicy_()
                  _posix_trace_attr_setstreamfullpolicy_()
    
           may be removed in a future version.
    


* * *