POSIX_TRA...TINHERITED(3P)
β¨ POSIX_TRA...TINHERITED(3P) β¨
okay bestie, so this page lives in the POSIX Programmer's Manual β yes, the whole "POSIX_TRA...TINHERITED(3P)" thing is literally just the header getting squished, don't worry about it π
πΈ 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.
translation: check your local Linux man page too, because Linux might do its own thing, or this might not even exist on your box π
π 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)
six functions, one mission: reading and writing the ~vibes~ of your trace stream π¦
β 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 π
okay so here's the tea β β 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 afork()orspawn()operation, the child shall not be traced, and tracing of the parent shall continue.POSIX_TRACE_INHERITEDβ after afork()orspawn()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. (so like, the child is on its own unless you say otherwise, no cap)
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. (out with the old, in with the new, it's giving circular energy π)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 theposix_log_full_statusmember status (see theposix_trace_status_infostructure defined in<trace.h>). The last recorded trace event shall be thePOSIX_TRACE_STOPtrace event.POSIX_TRACE_APPENDβ the associated trace stream shall be flushed to the trace log without log size limitation. If the application specifiesPOSIX_TRACE_APPEND, the implementation shall ignore the log-max-size attribute. (unlimited storage?? we love a maximalist moment β¨ but note the implementation just ignores log-max-size, periodt)
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 theposix_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 fromposix_stream_statusandposix_stream_full_status(see theposix_trace_status_infostructure defined in<trace.h>). When this trace stream is read, aPOSIX_TRACE_STOPtrace 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 theposix_trace_getnext_event(),posix_trace_trygetnext_event(), andposix_trace_timedgetnext_event()functionsβor already flushed for an active trace stream with log if the Trace Log option is supported; see theposix_trace_flush()function. The trace system shall restart the trace stream when it is empty and may restart it sooner. APOSIX_TRACE_STARTtrace event shall be reported before reporting the next recorded trace event. (it literally dies and then gets resurrected, main character energy π§)POSIX_TRACE_FLUSHβ if the Trace Log option is supported, this policy is identical to thePOSIX_TRACE_UNTIL_FULLtrace stream full policy except that the trace stream shall be flushed regularly as ifposix_trace_flush()had been explicitly called. Defining this policy for an active trace stream without log shall be invalid. β οΈ invalid!! do NOT do this one on an active trace stream without log β οΈ
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.
zero = slay, anything else = the error number, simple as that π«Ά
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. (undefined!! like, don't trust what's in there, bestie π)
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.
literally none. we move π
π¦ 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.
heads up bestie: these might get yeeted in a future version. it's giving deprecated-adjacent π
π SEE ALSO π
fork(), posix_trace_attr_destroy(), posix_trace_create(), posix_trace_get_attr(), posix_trace_getnext_event(), posix_trace_start()
The Base Definitions volume of POSIX.1β2017, <trace.h>
β COPYRIGHT β
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 .
and that's the whole page, bestie!! brought to you by IEEE/The Open Group, dated 2017 ππβ¨ go forth and trace responsibly, iykyk π«Ά
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms