sd_journal_get_cutoff_realtime_usec.html 6.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_journal_get_cutoff_realtime_usec</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
    a.headerlink {
      color: #c60f0f;
      font-size: 0.8em;
      padding: 0 4px 0 4px;
      text-decoration: none;
      visibility: hidden;
    }

    a.headerlink:hover {
      background-color: #c60f0f;
      color: white;
    }

    h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
      visibility: visible;
    }
  </style><a href="index.html">Index </a>·
  <a href="systemd.directives.html">Directives </a>·
  <a href="../python-systemd/index.html">Python </a>·
  <a href="../libudev/index.html">libudev </a>·
Michael Biebl's avatar
Michael Biebl committed
22
  <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="sd_journal_get_cutoff_realtime_usec"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_journal_get_cutoff_realtime_usec, sd_journal_get_cutoff_monotonic_usec — Read cut-off timestamps from the current journal entry</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-journal.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_journal_get_cutoff_realtime_usec</b>(</code></td><td>sd_journal *<var class="pdparam">j</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">from</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">to</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_journal_get_cutoff_monotonic_usec</b>(</code></td><td>sd_journal *<var class="pdparam">j</var>, </td></tr><tr><td> </td><td>sd_id128_t <var class="pdparam">boot_id</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">from</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">to</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm214196451792"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_journal_get_cutoff_realtime_usec()</code>
23 24 25
                gets the realtime (wallclock) timestamps of the first
                and last entries accessible in the journal.  It takes
                three arguments: the journal context object and two
Michael Biebl's avatar
Michael Biebl committed
26
                pointers to 64-bit unsigned integers to store the
27
                timestamps in. The timestamps are in microseconds
Michael Biebl's avatar
Michael Biebl committed
28 29 30 31 32
                since the epoch,
                i.e. <code class="constant">CLOCK_REALTIME</code>. Either one
                of the two timestamp arguments may be passed as
                <code class="constant">NULL</code> in case the timestamp is not
                needed, but not both.</p><p><code class="function">sd_journal_get_cutoff_monotonic_usec()</code>
33 34
                gets the monotonic timestamps of the first and last
                entries accessible in the journal. It takes three
Michael Biebl's avatar
Michael Biebl committed
35 36
                arguments: the journal context object, a 128-bit
                identifier for the boot, and two pointers to 64-bit
37 38
                unsigned integers to store the timestamps. The
                timestamps are in microseconds since boot-up of the
Michael Biebl's avatar
Michael Biebl committed
39 40
                specific boot,
                i.e. <code class="constant">CLOCK_MONOTONIC</code>. Since the
41 42 43 44 45 46 47
                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
                <a href="sd_id128_get_boot.html"><span class="citerefentry"><span class="refentrytitle">sd_id128_get_boot</span>(3)</span></a>
                for more information. The function will return the
                timestamps for the boot identified by the passed boot
                ID. Either one of the two timestamp arguments may be
Michael Biebl's avatar
Michael Biebl committed
48
                passed as <code class="constant">NULL</code> in case the
Michael Biebl's avatar
Michael Biebl committed
49
                timestamp is not needed, but not both.</p></div><div class="refsect1"><a name="idm214196646256"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p><code class="function">sd_journal_get_cutoff_realtime_usec()</code>
50 51 52
                and
                <code class="function">sd_journal_get_cutoff_monotonic_usec()</code>
                return 1 on success, 0 if not suitable entries are in
Michael Biebl's avatar
Michael Biebl committed
53
                the journal or a negative errno-style error code.</p></div><div class="refsect1"><a name="idm214196643584"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p>The
54 55 56
                <code class="function">sd_journal_get_cutoff_realtime_usec()</code>
                and
                <code class="function">sd_journal_get_cutoff_monotonic_usec()</code>
57
                interfaces are available as a shared library, which can
58
                be compiled and linked to with the
59
                <code class="constant">libsystemd</code> <a href="pkg-config.html"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
Michael Biebl's avatar
Michael Biebl committed
60
                file.</p></div><div class="refsect1"><a name="idm214196639424"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
61 62 63 64 65 66 67
                        <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
                        <a href="sd-journal.html"><span class="citerefentry"><span class="refentrytitle">sd-journal</span>(3)</span></a>,
                        <a href="sd_journal_open.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_open</span>(3)</span></a>,
                        <a href="sd_journal_get_realtime_usec.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_get_realtime_usec</span>(3)</span></a>,
                        <a href="sd_id128_get_boot.html"><span class="citerefentry"><span class="refentrytitle">sd_id128_get_boot</span>(3)</span></a>,
                        <a href="clock_gettime.html"><span class="citerefentry"><span class="refentrytitle">clock_gettime</span>(2)</span></a>
                </p></div></div></body></html>