POSIX_TRACE_CLOSE(3)       POSIX Programmer's Manual      POSIX_TRACE_CLOSE(3)



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


NNAAMMEE
       posix_trace_close, posix_trace_open, posix_trace_rewind -- trace log
       management (TTRRAACCIINNGG)

SSYYNNOOPPSSIISS
       #include <trace.h>

       int posix_trace_close(trace_id_t _t_r_i_d);
       int posix_trace_open(int _f_i_l_e___d_e_s_c, trace_id_t *_t_r_i_d);
       int posix_trace_rewind(trace_id_t _t_r_i_d);

DDEESSCCRRIIPPTTIIOONN
       The _p_o_s_i_x___t_r_a_c_e___c_l_o_s_e() function shall deallocate the trace log
       identifier indicated by _t_r_i_d, and all of its associated resources. If
       there is no valid trace log pointed to by the _t_r_i_d, this function shall
       fail.

       The _p_o_s_i_x___t_r_a_c_e___o_p_e_n() function shall allocate the necessary resources
       and establish the connection between a trace log identified by the
       _f_i_l_e___d_e_s_c argument and a trace stream identifier identified by the
       object pointed to by the _t_r_i_d argument. The _f_i_l_e___d_e_s_c argument should
       be a valid open file descriptor that corresponds to a trace log. The
       _f_i_l_e___d_e_s_c 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 _p_o_s_i_x___t_r_a_c_e___g_e_t_n_e_x_t___e_v_e_n_t(), shall be set
       to the timestamp of the oldest trace event recorded in the trace log
       identified by _t_r_i_d.

       The _p_o_s_i_x___t_r_a_c_e___o_p_e_n() function shall return a trace stream identifier
       in the variable pointed to by the _t_r_i_d argument, that may only be used
       by the following functions:

       _p_o_s_i_x___t_r_a_c_e___c_l_o_s_e()                      _p_o_s_i_x___t_r_a_c_e___g_e_t___a_t_t_r()
       _p_o_s_i_x___t_r_a_c_e___e_v_e_n_t_i_d___e_q_u_a_l()              _p_o_s_i_x___t_r_a_c_e___g_e_t___s_t_a_t_u_s()
       _p_o_s_i_x___t_r_a_c_e___e_v_e_n_t_i_d___g_e_t___n_a_m_e()           _p_o_s_i_x___t_r_a_c_e___g_e_t_n_e_x_t___e_v_e_n_t()
       _p_o_s_i_x___t_r_a_c_e___e_v_e_n_t_t_y_p_e_l_i_s_t___g_e_t_n_e_x_t___i_d()   _p_o_s_i_x___t_r_a_c_e___r_e_w_i_n_d()
       _p_o_s_i_x___t_r_a_c_e___e_v_e_n_t_t_y_p_e_l_i_s_t___r_e_w_i_n_d()

       In particular, notice that the operations normally used by a trace
       controller process, such as _p_o_s_i_x___t_r_a_c_e___s_t_a_r_t(), _p_o_s_i_x___t_r_a_c_e___s_t_o_p(), or
       _p_o_s_i_x___t_r_a_c_e___s_h_u_t_d_o_w_n(), cannot be invoked using the trace stream
       identifier returned by the _p_o_s_i_x___t_r_a_c_e___o_p_e_n() function.

       The _p_o_s_i_x___t_r_a_c_e___r_e_w_i_n_d() 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 _p_o_s_i_x___t_r_a_c_e___g_e_t_n_e_x_t___e_v_e_n_t(), to the
       timestamp of the oldest trace event recorded in the trace log
       identified by _t_r_i_d.

RREETTUURRNN VVAALLUUEE
       Upon successful completion, these functions shall return a value of
       zero. Otherwise, they shall return the corresponding error number.

       If successful, the _p_o_s_i_x___t_r_a_c_e___o_p_e_n() function stores the trace stream
       identifier value in the object pointed to by _t_r_i_d.

EERRRROORRSS
       The _p_o_s_i_x___t_r_a_c_e___o_p_e_n() function shall fail if:

       EEIINNTTRR  The operation was interrupted by a signal and thus no trace log
              was opened.

       EEIINNVVAALL The object pointed to by _f_i_l_e___d_e_s_c does not correspond to a
              valid trace log.

       The _p_o_s_i_x___t_r_a_c_e___c_l_o_s_e() and _p_o_s_i_x___t_r_a_c_e___r_e_w_i_n_d() functions may fail if:

       EEIINNVVAALL The object pointed to by _t_r_i_d does not correspond to a valid
              trace log.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

EEXXAAMMPPLLEESS
       None.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       The _p_o_s_i_x___t_r_a_c_e___c_l_o_s_e(), _p_o_s_i_x___t_r_a_c_e___o_p_e_n(), and _p_o_s_i_x___t_r_a_c_e___r_e_w_i_n_d()
       functions may be removed in a future version.

SSEEEE AALLSSOO
       _p_o_s_i_x___t_r_a_c_e___g_e_t___a_t_t_r(), _p_o_s_i_x___t_r_a_c_e___g_e_t___f_i_l_t_e_r(),
       _p_o_s_i_x___t_r_a_c_e___g_e_t_n_e_x_t___e_v_e_n_t()

       The Base Definitions volume of POSIX.1-2008, <<ttrraaccee..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
       -- Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, Copyright (C) 2013 by the Institute of
       Electrical and Electronics Engineers, Inc and The Open Group.  (This is
       POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
       event of any discrepancy between this version and the original IEEE and
       The Open Group Standard, the original IEEE and The Open Group Standard
       is the referee document. The original Standard can be obtained online
       at http://www.unix.org/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2013                 POSIX_TRACE_CLOSE(3)
