POSIX_TRACE_ATTR_GETINHERITEPDO(S3I)X Programmer's MPaOnSuIaXl_TRACE_ATTR_GETINHERITED(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_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 (TTRRAACCIINNGG)

SSYYNNOOPPSSIISS
       #include <trace.h>

       int posix_trace_attr_getinherited(const trace_attr_t *restrict _a_t_t_r,
           int *restrict _i_n_h_e_r_i_t_a_n_c_e_p_o_l_i_c_y);
       int posix_trace_attr_getlogfullpolicy(const trace_attr_t *restrict _a_t_t_r,
           int *restrict _l_o_g_p_o_l_i_c_y);
       int posix_trace_attr_getstreamfullpolicy(const trace_attr_t *restrict
           _a_t_t_r, int *restrict _s_t_r_e_a_m_p_o_l_i_c_y);
       int posix_trace_attr_setinherited(trace_attr_t *_a_t_t_r,
           int _i_n_h_e_r_i_t_a_n_c_e_p_o_l_i_c_y);
       int posix_trace_attr_setlogfullpolicy(trace_attr_t *_a_t_t_r,
           int _l_o_g_p_o_l_i_c_y);
       int posix_trace_attr_setstreamfullpolicy(trace_attr_t *_a_t_t_r,
           int _s_t_r_e_a_m_p_o_l_i_c_y);

DDEESSCCRRIIPPTTIIOONN
       The _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_i_n_h_e_r_i_t_e_d() and _p_o_s_i_x___t_r_a_c_e___a_t_t_r___s_e_t_i_n_h_e_r_i_t_e_d()
       functions, respectively, shall get and set the inheritance policy
       stored in the _i_n_h_e_r_i_t_a_n_c_e attribute for traced processes across the
       _f_o_r_k() and _s_p_a_w_n() operations. The _i_n_h_e_r_i_t_a_n_c_e attribute of the
       attributes object pointed to by the _a_t_t_r argument shall be set to one
       of the following values defined by manifest constants in the _<_t_r_a_c_e_._h_>
       header:

       POSIX_TRACE_CLOSE_FOR_CHILD
             After a _f_o_r_k() or _s_p_a_w_n() operation, the child shall not be
             traced, and tracing of the parent shall continue.

       POSIX_TRACE_INHERITED
             After a _f_o_r_k() or _s_p_a_w_n() operation, if the parent is being
             traced, its child shall be concurrently traced using the same
             trace stream.

       The default value for the _i_n_h_e_r_i_t_a_n_c_e attribute is
       POSIX_TRACE_CLOSE_FOR_CHILD.

       The _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_l_o_g_f_u_l_l_p_o_l_i_c_y() and
       _p_o_s_i_x___t_r_a_c_e___a_t_t_r___s_e_t_l_o_g_f_u_l_l_p_o_l_i_c_y() functions, respectively, shall get
       and set the trace log full policy stored in the _l_o_g_-_f_u_l_l_-_p_o_l_i_c_y
       attribute of the attributes object pointed to by the _a_t_t_r argument.

       The _l_o_g_-_f_u_l_l_-_p_o_l_i_c_y attribute shall be set to one of the following
       values defined by manifest constants in the _<_t_r_a_c_e_._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
             _p_o_s_i_x___l_o_g___f_u_l_l___s_t_a_t_u_s member status (see the
             ppoossiixx__ttrraaccee__ssttaattuuss__iinnffoo structure defined in _<_t_r_a_c_e_._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 _l_o_g_-_m_a_x_-
             _s_i_z_e attribute.

       The default value for the _l_o_g_-_f_u_l_l_-_p_o_l_i_c_y attribute is
       POSIX_TRACE_LOOP.

       The _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_s_t_r_e_a_m_f_u_l_l_p_o_l_i_c_y() and
       _p_o_s_i_x___t_r_a_c_e___a_t_t_r___s_e_t_s_t_r_e_a_m_f_u_l_l_p_o_l_i_c_y() functions, respectively, shall
       get and set the trace stream full policy stored in the _s_t_r_e_a_m_-_f_u_l_l_-
       _p_o_l_i_c_y attribute of the attributes object pointed to by the _a_t_t_r
       argument.

       The _s_t_r_e_a_m_-_f_u_l_l_-_p_o_l_i_c_y attribute shall be set to one of the following
       values defined by manifest constants in the _<_t_r_a_c_e_._h_> header:

       POSIX_TRACE_LOOP
             The trace stream shall loop until explicitly stopped by the
             _p_o_s_i_x___t_r_a_c_e___s_t_o_p() 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 _p_o_s_i_x___s_t_r_e_a_m___s_t_a_t_u_s and _p_o_s_i_x___s_t_r_e_a_m___f_u_l_l___s_t_a_t_u_s
             (see the ppoossiixx__ttrraaccee__ssttaattuuss__iinnffoo structure defined in _<_t_r_a_c_e_._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 _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___t_r_y_g_e_t_n_e_x_t___e_v_e_n_t(), and
             _p_o_s_i_x___t_r_a_c_e___t_i_m_e_d_g_e_t_n_e_x_t___e_v_e_n_t() functions--or already flushed
             for an active trace stream with log if the Trace Log option is
             supported; see the _p_o_s_i_x___t_r_a_c_e___f_l_u_s_h() 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
             _p_o_s_i_x___t_r_a_c_e___f_l_u_s_h() had been explicitly called. Defining this
             policy for an active trace stream without log shall be invalid.

       The default value for the _s_t_r_e_a_m_-_f_u_l_l_-_p_o_l_i_c_y 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 _s_t_r_e_a_m_-
       _f_u_l_l_-_p_o_l_i_c_y attribute shall be POSIX_TRACE_FLUSH for an active trace
       stream with log.

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___a_t_t_r___g_e_t_i_n_h_e_r_i_t_e_d() function shall store
       the _i_n_h_e_r_i_t_a_n_c_e attribute value in the object pointed to by
       _i_n_h_e_r_i_t_a_n_c_e_p_o_l_i_c_y.  Otherwise, the content of this object is undefined.

       If successful, the _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_l_o_g_f_u_l_l_p_o_l_i_c_y() function shall
       store the _l_o_g_-_f_u_l_l_-_p_o_l_i_c_y attribute value in the object pointed to by
       _l_o_g_p_o_l_i_c_y.  Otherwise, the content of this object is undefined.

       If successful, the _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_s_t_r_e_a_m_f_u_l_l_p_o_l_i_c_y() function
       shall store the _s_t_r_e_a_m_-_f_u_l_l_-_p_o_l_i_c_y attribute value in the object
       pointed to by _s_t_r_e_a_m_p_o_l_i_c_y.  Otherwise, the content of this object is
       undefined.

EERRRROORRSS
       These functions may fail if:

       EEIINNVVAALL The value specified by at least one of the arguments is invalid.

       _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 following functions:

              _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_i_n_h_e_r_i_t_e_d()
              _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_l_o_g_f_u_l_l_p_o_l_i_c_y()
              _p_o_s_i_x___t_r_a_c_e___a_t_t_r___g_e_t_s_t_r_e_a_m_f_u_l_l_p_o_l_i_c_y()
              _p_o_s_i_x___t_r_a_c_e___a_t_t_r___s_e_t_i_n_h_e_r_i_t_e_d()
              _p_o_s_i_x___t_r_a_c_e___a_t_t_r___s_e_t_l_o_g_f_u_l_l_p_o_l_i_c_y()
              _p_o_s_i_x___t_r_a_c_e___a_t_t_r___s_e_t_s_t_r_e_a_m_f_u_l_l_p_o_l_i_c_y()

       may be removed in a future version.

SSEEEE AALLSSOO
       _f_o_r_k(), _p_o_s_i_x___t_r_a_c_e___a_t_t_r___d_e_s_t_r_o_y(), _p_o_s_i_x___t_r_a_c_e___c_r_e_a_t_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___g_e_t_n_e_x_t___e_v_e_n_t(),
       _p_o_s_i_x___t_r_a_c_e___s_t_a_r_t()

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

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  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.opengroup.org/unix/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                  2017     POSIX_TRACE_ATTR_GETINHERITED(3)
