129 lines
4.6 KiB
HTML
129 lines
4.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_JOURNAL_GET_REALTIME_USEC</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_JOURNAL_GET_REALTIME_USEC</H1>
|
|
Section: sd_journal_get_realtime_usec (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_journal_get_realtime_usec, sd_journal_get_monotonic_usec - Read timestamps from the current journal entry
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-journal.h">systemd/sd-journal.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>int sd_journal_get_realtime_usec(sd_journal *</B><I>j</I><B>, uint64_t *</B><I>usec</I><B>);</B>
|
|
|
|
<DT id="2">
|
|
<B>int sd_journal_get_monotonic_usec(sd_journal *</B><I>j</I><B>, uint64_t *</B><I>usec</I><B>, sd_id128_t *</B><I>boot_id</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_journal_get_realtime_usec()</B>
|
|
<DD>gets the realtime (wallclock) timestamp of the current journal entry. It takes two arguments: the journal context object and a pointer to a 64-bit unsigned integer to store the timestamp in. The timestamp is in microseconds since the epoch, i.e.
|
|
<B>CLOCK_REALTIME</B>.
|
|
<P>
|
|
|
|
<B>sd_journal_get_monotonic_usec()</B>
|
|
gets the monotonic timestamp of the current journal entry. It takes three arguments: the journal context object, a pointer to a 64-bit unsigned integer to store the timestamp in, as well as a 128-bit ID buffer to store the boot ID of the monotonic timestamp. The timestamp is in microseconds since boot-up of the specific boot, i.e.
|
|
<B>CLOCK_MONOTONIC</B>. Since the monotonic clock begins new with every reboot, it only defines a well-defined point in time when used together with an identifier identifying the boot. See
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_id128_get_boot">sd_id128_get_boot</A></B>(3)
|
|
for more information. If the boot ID parameter is passed
|
|
<B>NULL</B>, the function will fail if the monotonic timestamp of the current entry is not of the current system boot.
|
|
<P>
|
|
|
|
Note that these functions will not work before
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_journal_next">sd_journal_next</A></B>(3)
|
|
(or related call) has been called at least once, in order to position the read pointer at a valid entry.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_journal_get_realtime_usec()</B>
|
|
and
|
|
<B>sd_journal_get_monotonic_usec()</B>
|
|
returns 0 on success or a negative errno-style error code. If the boot ID parameter was passed
|
|
<B>NULL</B>
|
|
and the monotonic timestamp of the current journal entry is not of the current system boot,
|
|
<B>-ESTALE</B>
|
|
is returned by
|
|
<B>sd_journal_get_monotonic_usec()</B>.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
|
|
All functions listed here are thread-agnostic and only a single specific thread may operate on a given object during its entire lifetime. It's safe to allocate multiple independent objects and use each from a specific thread in parallel. However, it's not safe to allocate such an object in one thread, and operate or free it from any other, even if locking is used to ensure these threads don't operate on it at the very same time.
|
|
<P>
|
|
|
|
These APIs are implemented as a shared library, which can be compiled and linked to with the
|
|
<B>libsystemd</B> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-journal">sd-journal</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_journal_open">sd_journal_open</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_journal_next">sd_journal_next</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_journal_get_data">sd_journal_get_data</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_id128_get_boot">sd_id128_get_boot</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?2+clock_gettime">clock_gettime</A></B>(2),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_journal_get_cutoff_realtime_usec">sd_journal_get_cutoff_realtime_usec</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="6"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DT id="7"><A HREF="#lbAF">NOTES</A><DD>
|
|
<DT id="8"><A HREF="#lbAG">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:55 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|