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