]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_journal_get_cutoff_realtime_usec.xml
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / man / sd_journal_get_cutoff_realtime_usec.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="sd_journal_get_cutoff_realtime_usec" xmlns:xi="http://www.w3.org/2001/XInclude">
10
11 <refentryinfo>
12 <title>sd_journal_get_cutoff_realtime_usec</title>
13 <productname>systemd</productname>
14
15 <authorgroup>
16 <author>
17 <contrib>Developer</contrib>
18 <firstname>Lennart</firstname>
19 <surname>Poettering</surname>
20 <email>lennart@poettering.net</email>
21 </author>
22 </authorgroup>
23 </refentryinfo>
24
25 <refmeta>
26 <refentrytitle>sd_journal_get_cutoff_realtime_usec</refentrytitle>
27 <manvolnum>3</manvolnum>
28 </refmeta>
29
30 <refnamediv>
31 <refname>sd_journal_get_cutoff_realtime_usec</refname>
32 <refname>sd_journal_get_cutoff_monotonic_usec</refname>
33 <refpurpose>Read cut-off timestamps from the current journal entry</refpurpose>
34 </refnamediv>
35
36 <refsynopsisdiv>
37 <funcsynopsis>
38 <funcsynopsisinfo>#include &lt;systemd/sd-journal.h&gt;</funcsynopsisinfo>
39
40 <funcprototype>
41 <funcdef>int <function>sd_journal_get_cutoff_realtime_usec</function></funcdef>
42 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
43 <paramdef>uint64_t *<parameter>from</parameter></paramdef>
44 <paramdef>uint64_t *<parameter>to</parameter></paramdef>
45 </funcprototype>
46
47 <funcprototype>
48 <funcdef>int <function>sd_journal_get_cutoff_monotonic_usec</function></funcdef>
49 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
50 <paramdef>sd_id128_t <parameter>boot_id</parameter></paramdef>
51 <paramdef>uint64_t *<parameter>from</parameter></paramdef>
52 <paramdef>uint64_t *<parameter>to</parameter></paramdef>
53 </funcprototype>
54
55 </funcsynopsis>
56 </refsynopsisdiv>
57
58 <refsect1>
59 <title>Description</title>
60
61 <para><function>sd_journal_get_cutoff_realtime_usec()</function>
62 retrieves the realtime (wallclock) timestamps of the first and
63 last entries accessible in the journal. It takes three arguments:
64 the journal context object <parameter>j</parameter> and two
65 pointers <parameter>from</parameter> and <parameter>to</parameter>
66 pointing at 64-bit unsigned integers to store the timestamps in.
67 The timestamps are in microseconds since the epoch, i.e.
68 <constant>CLOCK_REALTIME</constant>. Either one of the two
69 timestamp arguments may be passed as <constant>NULL</constant> in
70 case the timestamp is not needed, but not both.</para>
71
72 <para><function>sd_journal_get_cutoff_monotonic_usec()</function>
73 retrieves the monotonic timestamps of the first and last entries
74 accessible in the journal. It takes three arguments: the journal
75 context object <parameter>j</parameter>, a 128-bit identifier for
76 the boot <parameter>boot_id</parameter>, and two pointers to
77 64-bit unsigned integers to store the timestamps,
78 <parameter>from</parameter> and <parameter>to</parameter>. The
79 timestamps are in microseconds since boot-up of the specific boot,
80 i.e. <constant>CLOCK_MONOTONIC</constant>. Since the monotonic
81 clock begins new with every reboot it only defines a well-defined
82 point in time when used together with an identifier identifying
83 the boot, see
84 <citerefentry><refentrytitle>sd_id128_get_boot</refentrytitle><manvolnum>3</manvolnum></citerefentry>
85 for more information. The function will return the timestamps for
86 the boot identified by the passed boot ID. Either one of the two
87 timestamp arguments may be passed as <constant>NULL</constant> in
88 case the timestamp is not needed, but not both.</para>
89 </refsect1>
90
91 <refsect1>
92 <title>Return Value</title>
93
94 <para><function>sd_journal_get_cutoff_realtime_usec()</function>
95 and <function>sd_journal_get_cutoff_monotonic_usec()</function>
96 return 1 on success, 0 if not suitable entries are in the journal
97 or a negative errno-style error code.</para>
98
99 <para>Locations pointed to by parameters
100 <parameter>from</parameter> and <parameter>to</parameter> will be
101 set only if the return value is positive, and obviously, the
102 parameters are non-null.</para>
103 </refsect1>
104
105 <refsect1>
106 <title>Notes</title>
107
108 <para>All functions listed here are thread-agnostic and only a single thread may operate
109 on a given <structname>sd_journal</structname> object.</para>
110
111 <xi:include href="libsystemd-pkgconfig.xml" xpointer="pkgconfig-text"/>
112 </refsect1>
113
114 <refsect1>
115 <title>See Also</title>
116
117 <para>
118 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
119 <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
120 <citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
121 <citerefentry><refentrytitle>sd_journal_get_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
122 <citerefentry><refentrytitle>sd_id128_get_boot</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
123 <citerefentry><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>
124 </para>
125 </refsect1>
126
127 </refentry>