]> git.proxmox.com Git - systemd.git/blame - man/sd_journal_seek_cursor.html
Imported Upstream version 217
[systemd.git] / man / sd_journal_seek_cursor.html
CommitLineData
663996b3
MS
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_journal_seek_head</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
5eef597e
MP
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 217</span><hr><div class="refentry"><a name="sd_journal_seek_head"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_journal_seek_head, sd_journal_seek_tail, sd_journal_seek_monotonic_usec, sd_journal_seek_realtime_usec, sd_journal_seek_cursor — Seek to a position in the
23 journal</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_seek_head</b>(</code></td><td>sd_journal *<var class="pdparam">j</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_seek_tail</b>(</code></td><td>sd_journal *<var class="pdparam">j</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_seek_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">usec</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_seek_realtime_usec</b>(</code></td><td>sd_journal *<var class="pdparam">j</var>, </td></tr><tr><td> </td><td>uint64_t <var class="pdparam">usec</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_seek_cursor</b>(</code></td><td>sd_journal *<var class="pdparam">j</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">cursor</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm214188285792"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><code class="function">sd_journal_seek_head()</code>
663996b3 24 seeks to the beginning of the journal, i.e. the oldest
60f067b4 25 available entry.</p><p>Similarly,
663996b3
MS
26 <code class="function">sd_journal_seek_tail()</code> may be
27 used to seek to the end of the journal, i.e. the most
28 recent available entry.</p><p><code class="function">sd_journal_seek_monotonic_usec()</code>
29 seeks to the entry with the specified monotonic
14228c0d
MB
30 timestamp,
31 i.e. <code class="constant">CLOCK_MONOTONIC</code>. Since
32 monotonic time restarts on every reboot a boot ID
33 needs to be specified as well.</p><p><code class="function">sd_journal_seek_realtime_usec()</code>
663996b3 34 seeks to the entry with the specified realtime
14228c0d
MB
35 (wallclock) timestamp,
36 i.e. <code class="constant">CLOCK_REALTIME</code>. Note that
663996b3 37 the realtime clock is not necessarily monotonic. If a
14228c0d 38 realtime timestamp is ambiguous, it is not defined
663996b3
MS
39 which position is sought to.</p><p><code class="function">sd_journal_seek_cursor()</code>
40 seeks to the entry located at the specified cursor
14228c0d 41 string. For details on cursors, see
663996b3
MS
42 <a href="sd_journal_get_cursor.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_get_cursor</span>(3)</span></a>. If
43 no entry matching the specified cursor is found the
44 call will seek to the next closest entry (in terms of
45 time) instead. To verify whether the newly selected
14228c0d 46 entry actually matches the cursor, use
663996b3
MS
47 <a href="sd_journal_test_cursor.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_test_cursor</span>(3)</span></a>.</p><p>Note that these calls do not actually make any
48 entry the new current entry, this needs to be done in
49 a separate step with a subsequent
50 <a href="sd_journal_next.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_next</span>(3)</span></a>
14228c0d 51 invocation (or a similar call). Only then, entry data
663996b3
MS
52 may be retrieved via
53 <a href="sd_journal_get_data.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_get_data</span>(3)</span></a>. If
54 no entry exists that matches exactly the specified
14228c0d 55 seek address, the next closest is sought to. If
663996b3 56 <a href="sd_journal_next.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_next</span>(3)</span></a>
14228c0d 57 is used, the closest following entry will be sought to,
663996b3
MS
58 if
59 <a href="sd_journal_previous.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_previous</span>(3)</span></a>
60 is used the closest preceding entry is sought
5eef597e
MP
61 to.</p></div><div class="refsect1"><a name="idm214188272048"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value">¶</a></h2><p>The functions return 0 on success or a negative
62 errno-style error code.</p></div><div class="refsect1"><a name="idm214188263536"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes">¶</a></h2><p>The <code class="function">sd_journal_seek_head()</code>,
663996b3
MS
63 <code class="function">sd_journal_seek_tail()</code>,
64 <code class="function">sd_journal_seek_monotonic_usec()</code>,
65 <code class="function">sd_journal_seek_realtime_usec()</code>,
66 and <code class="function">sd_journal_seek_cursor()</code>
60f067b4 67 interfaces are available as a shared library, which can
663996b3 68 be compiled and linked to with the
5eef597e
MP
69 <code class="constant">libsystemd</code> <a href="http://linux.die.net/man/1/pkg-config"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
70 file.</p></div><div class="refsect1"><a name="idm214188256944"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
663996b3
MS
71 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
72 <a href="sd-journal.html"><span class="citerefentry"><span class="refentrytitle">sd-journal</span>(3)</span></a>,
73 <a href="sd_journal_open.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_open</span>(3)</span></a>,
74 <a href="sd_journal_next.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_next</span>(3)</span></a>,
75 <a href="sd_journal_get_data.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_get_data</span>(3)</span></a>,
76 <a href="sd_journal_get_cursor.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_get_cursor</span>(3)</span></a>,
77 <a href="sd_journal_get_realtime_usec.html"><span class="citerefentry"><span class="refentrytitle">sd_journal_get_realtime_usec</span>(3)</span></a>
78 </p></div></div></body></html>