# posix_trace_clear

## 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_clear — clear trace stream and trace log (**TRACING**)
    


## SYNOPSIS



           #include <sys/types.h>
           #include <trace.h>
    
           int posix_trace_clear(trace_id_t _trid_);
    


## DESCRIPTION



           The _posix_trace_clear_() function shall reinitialize the trace
           stream identified by the argument _trid_ as if it were returning
           from the _posix_trace_create_() function, except that the same
           allocated resources shall be reused, the mapping of trace event
           type identifiers to trace event names shall be unchanged, and the
           trace stream status shall remain unchanged (that is, if it was
           running, it remains running and if it was suspended, it remains
           suspended).
    
           All trace events in the trace stream recorded before the call to
           _posix_trace_clear_() shall be lost. The _posix_stream_full_status_
           status shall be set to POSIX_TRACE_NOT_FULL.  There is no
           guarantee that all trace events that occurred during the
           _posix_trace_clear_() call are recorded; the behavior with respect
           to trace points that may occur during this call is unspecified.
    
           If the Trace Log option is supported and the trace stream has been
           created with a log, the _posix_trace_clear_() function shall
           reinitialize the trace stream with the same behavior as if the
           trace stream was created without the log, plus it shall
           reinitialize the trace log associated with the trace stream
           identified by the argument _trid_ as if it were returning from the
           _posix_trace_create_withlog_() function, except that the same
           allocated resources, for the trace log, may be reused and the
           associated trace stream status remains unchanged.  The first trace
           event recorded in the trace log after the call to
           _posix_trace_clear_() shall be the same as the first trace event
           recorded in the active trace stream after the call to
           _posix_trace_clear_().  The _posix_log_full_status_ status shall be
           set to POSIX_TRACE_NOT_FULL. There is no guarantee that all trace
           events that occurred during the _posix_trace_clear_() call are
           recorded in the trace log; the behavior with respect to trace
           points that may occur during this call is unspecified. If the log
           full policy is POSIX_TRACE_APPEND, the effect of a call to this
           function is unspecified for the trace log associated with the
           trace stream identified by the _trid_ argument.
    


## RETURN VALUE



           Upon successful completion, the _posix_trace_clear_() function shall
           return a value of zero. Otherwise, it shall return the
           corresponding error number.
    


## ERRORS



           The _posix_trace_clear_() function shall fail if:
    
           **EINVAL** The value of the _trid_ argument does not correspond to an
                  active trace stream.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           None.
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           The _posix_trace_clear_() function may be removed in a future
           version.
    


* * *