POSIX_TRA...TCLOCKRES(3P)

✨ POSIX_TRA...TCLOCKRES(3P) β€” POSIX Programmer's Manual ✨

okay bestie, welcome to a page from the POSIX Programmer's Manual, section 3P πŸ’–. Grab a strawberry πŸ“ and let's get into it.

🌸 PROLOG 🌸

This manual page is part of the POSIX Programmer's Manual. Heads up though: the Linux implementation of this interface may differ β€” so go peek at the corresponding Linux manual page for the deets on Linux behavior. Also, lowkey, the interface might just... not be implemented on Linux at all. πŸ’€


πŸ‘‘ NAME πŸ‘‘

posix_trace_attr_getclockres, posix_trace_attr_getcreatetime, posix_trace_attr_getgenversion, posix_trace_attr_getname, posix_trace_attr_setname β€” retrieve and set information about a trace stream (TRACING). yes the name is long, it's giving "I have five government names" energy, we move. πŸ’…


✨ SYNOPSIS ✨

#include <time.h>
#include <trace.h>

int posix_trace_attr_getclockres(const trace_attr_t *attr,
    struct timespec *resolution);
int posix_trace_attr_getcreatetime(const trace_attr_t *attr,
    struct timespec *createtime);

#include <trace.h>

int posix_trace_attr_getgenversion(const trace_attr_t *attr,
    char *genversion);
int posix_trace_attr_getname(const trace_attr_t *attr,
    char *tracename);
int posix_trace_attr_setname(trace_attr_t *attr,
    const char *tracename);

πŸ’– DESCRIPTION πŸ’–

so here's the whole vibe, function by function πŸ¦‹

  • posix_trace_attr_getclockres() β€” shall copy the clock resolution of the clock used to generate timestamps, taking it from the clock-resolution attribute of the attributes object that attr points to, and dropping it into the structure that resolution points to. πŸ•
  • posix_trace_attr_getcreatetime() β€” shall copy the trace stream creation time from the creation-time attribute of the attributes object that attr points to, into the structure that createtime points to. That creation-time attribute shall represent the time of creation of the trace stream. ⭐
  • posix_trace_attr_getgenversion() β€” shall copy the string containing version information from the generation-version attribute of the attributes object that attr points to, into the string that genversion points to. And genversion shall be the address of a character array that can store at least {TRACE_NAME_MAX} characters β€” no smaller, bestie, we need the room. πŸ“
  • posix_trace_attr_getname() β€” shall copy the string containing the trace name from the trace-name attribute of the attributes object that attr points to, into the string that tracename points to. Same deal: tracename shall be the address of a character array which can store at least {TRACE_NAME_MAX} characters. πŸŽ€
  • posix_trace_attr_setname() β€” shall set the name in the trace-name attribute of the attributes object that attr points to, using the trace name string supplied by tracename. Now listen πŸ‘€: if the supplied string contains more than {TRACE_NAME_MAX} characters, the name copied into the trace-name attribute may be truncated to one less than the length of {TRACE_NAME_MAX} characters. And the default value? A null string. iconically empty. 🫢

🌈 RETURN VALUE 🌈

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

And when they do succeed, here's where the goods land:

  • If successful, posix_trace_attr_getclockres() stores the clock-resolution attribute value in the object pointed to by resolution. Otherwise, the content of this object is unspecified. πŸ™ˆ
  • If successful, posix_trace_attr_getcreatetime() stores the trace stream creation time in the object pointed to by createtime. Otherwise, the content of this object is unspecified. πŸ™ˆ
  • If successful, posix_trace_attr_getgenversion() stores the trace version information in the string pointed to by genversion. Otherwise, the content of this string is unspecified. πŸ™ˆ
  • If successful, posix_trace_attr_getname() stores the trace name in the string pointed to by tracename. Otherwise, the content of this string is unspecified. πŸ™ˆ

πŸ’€ ERRORS πŸ’€

posix_trace_attr_getclockres(), posix_trace_attr_getcreatetime(), posix_trace_attr_getgenversion(), and posix_trace_attr_getname() may fail if:

  • EINVAL β€” The value specified by one of the arguments is invalid.
also just a lil note: the following sections are informative. πŸ“

πŸŽ€ EXAMPLES πŸŽ€

None. (the void, the silence, the emptiness β€” very demure ✨)


🧚 APPLICATION USAGE 🧚

None. (again! nothing! we love a low-maintenance section πŸ’œ)


πŸ’… RATIONALE πŸ’…

None. (she said nothing and she ate 🍽️)


⭐ FUTURE DIRECTIONS ⭐

bestie, sit down. posix_trace_attr_getclockres(), posix_trace_attr_getcreatetime(), posix_trace_attr_getgenversion(), posix_trace_attr_getname(), and posix_trace_attr_setname() may be removed in a future version. 🫠 so enjoy them while they're here i guess.


πŸ”₯ SEE ALSO πŸ”₯

  • posix_trace_attr_destroy()
  • posix_trace_create()
  • posix_trace_get_attr()
  • uname()

The Base Definitions volume of POSIX.1‐2017: <time.h>, <trace.h>


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, 2017, page POSIX_TRA...TCLOCKRES(3P). slay, stay traced, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from