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