# posix_trace_close

## 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_close, posix_trace_open, posix_trace_rewind — trace
           log management (**TRACING**)
    


## SYNOPSIS



           #include <trace.h>
    
           int posix_trace_close(trace_id_t _trid_);
           int posix_trace_open(int _file_desc_ , trace_id_t *_trid_);
           int posix_trace_rewind(trace_id_t _trid_);
    


## DESCRIPTION



           The _posix_trace_close_() function shall deallocate the trace log
           identifier indicated by _trid_ , and all of its associated resources.
           If there is no valid trace log pointed to by the _trid_ , this
           function shall fail.
    
           The _posix_trace_open_() function shall allocate the necessary
           resources and establish the connection between a trace log
           identified by the _file_desc_ argument and a trace stream identifier
           identified by the object pointed to by the _trid_ argument. The
           _file_desc_ argument should be a valid open file descriptor that
           corresponds to a trace log. The _file_desc_ argument shall be open
           for reading. The current trace event timestamp, which specifies
           the timestamp of the trace event that will be read by the next
           call to _posix_trace_getnext_event_(), shall be set to the timestamp
           of the oldest trace event recorded in the trace log identified by
           _trid_.
    
           The _posix_trace_open_() function shall return a trace stream
           identifier in the variable pointed to by the _trid_ argument, that
           may only be used by the following functions:
           _posix_trace_close_()                      _posix_trace_get_attr_()
           _posix_trace_eventid_equal_()              _posix_trace_get_status_()
           _posix_trace_eventid_get_name_()           _posix_trace_getnext_event_()
           _posix_trace_eventtypelist_getnext_id_()   _posix_trace_rewind_()
           _posix_trace_eventtypelist_rewind_()
    
           In particular, notice that the operations normally used by a trace
           controller process, such as _posix_trace_start_(),
           _posix_trace_stop_(), or _posix_trace_shutdown_(), cannot be invoked
           using the trace stream identifier returned by the
           _posix_trace_open_() function.
    
           The _posix_trace_rewind_() function shall reset the current trace
           event timestamp, which specifies the timestamp of the trace event
           that will be read by the next call to _posix_trace_getnext_event_(),
           to the timestamp of the oldest trace event recorded in the trace
           log identified by _trid_.
    


## 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_open_() function stores the trace
           stream identifier value in the object pointed to by _trid_.
    


## ERRORS



           The _posix_trace_open_() function shall fail if:
    
           **EINTR** The operation was interrupted by a signal and thus no trace
                  log was opened.
    
           **EINVAL** The object pointed to by _file_desc_ does not correspond to a
                  valid trace log.
    
           The _posix_trace_close_() and _posix_trace_rewind_() functions may
           fail if:
    
           **EINVAL** The object pointed to by _trid_ does not correspond to a
                  valid trace log.
    
           _The following sections are informative._
    


## EXAMPLES



           None.
    


## APPLICATION USAGE



           None.
    


## RATIONALE



           None.
    


## FUTURE DIRECTIONS



           The _posix_trace_close_(), _posix_trace_open_(), and
           _posix_trace_rewind_() functions may be removed in a future version.
    


* * *