]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_journal_get_cutoff_realtime_usec.xml
man: generate configured paths in manpages
[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 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 This file is part of systemd.
10
11 Copyright 2012 Lennart Poettering
12
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 -->
26
27 <refentry id="sd_journal_get_cutoff_realtime_usec">
28
29 <refentryinfo>
30 <title>sd_journal_get_cutoff_realtime_usec</title>
31 <productname>systemd</productname>
32
33 <authorgroup>
34 <author>
35 <contrib>Developer</contrib>
36 <firstname>Lennart</firstname>
37 <surname>Poettering</surname>
38 <email>lennart@poettering.net</email>
39 </author>
40 </authorgroup>
41 </refentryinfo>
42
43 <refmeta>
44 <refentrytitle>sd_journal_get_cutoff_realtime_usec</refentrytitle>
45 <manvolnum>3</manvolnum>
46 </refmeta>
47
48 <refnamediv>
49 <refname>sd_journal_get_cutoff_realtime_usec</refname>
50 <refname>sd_journal_get_cutoff_monotonic_usec</refname>
51 <refpurpose>Read cut-off timestamps from the current journal entry</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <funcsynopsis>
56 <funcsynopsisinfo>#include &lt;systemd/sd-journal.h&gt;</funcsynopsisinfo>
57
58 <funcprototype>
59 <funcdef>int <function>sd_journal_get_cutoff_realtime_usec</function></funcdef>
60 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
61 <paramdef>uint64_t *<parameter>from</parameter></paramdef>
62 <paramdef>uint64_t *<parameter>to</parameter></paramdef>
63 </funcprototype>
64
65 <funcprototype>
66 <funcdef>int <function>sd_journal_get_cutoff_monotonic_usec</function></funcdef>
67 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
68 <paramdef>sd_id128_t <parameter>boot_id</parameter></paramdef>
69 <paramdef>uint64_t *<parameter>from</parameter></paramdef>
70 <paramdef>uint64_t *<parameter>to</parameter></paramdef>
71 </funcprototype>
72
73 </funcsynopsis>
74 </refsynopsisdiv>
75
76 <refsect1>
77 <title>Description</title>
78
79 <para><function>sd_journal_get_cutoff_realtime_usec()</function>
80 retrieves the realtime (wallclock) timestamps of the first and
81 last entries accessible in the journal. It takes three arguments:
82 the journal context object <parameter>j</parameter> and two
83 pointers <parameter>from</parameter> and <parameter>to</parameter>
84 pointing at 64-bit unsigned integers to store the timestamps in.
85 The timestamps are in microseconds since the epoch, i.e.
86 <constant>CLOCK_REALTIME</constant>. 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
90 <para><function>sd_journal_get_cutoff_monotonic_usec()</function>
91 retrieves the monotonic timestamps of the first and last entries
92 accessible in the journal. It takes three arguments: the journal
93 context object <parameter>j</parameter>, a 128-bit identifier for
94 the boot <parameter>boot_id</parameter>, and two pointers to
95 64-bit unsigned integers to store the timestamps,
96 <parameter>from</parameter> and <parameter>to</parameter>. The
97 timestamps are in microseconds since boot-up of the specific boot,
98 i.e. <constant>CLOCK_MONOTONIC</constant>. Since the monotonic
99 clock begins new with every reboot it only defines a well-defined
100 point in time when used together with an identifier identifying
101 the boot, see
102 <citerefentry><refentrytitle>sd_id128_get_boot</refentrytitle><manvolnum>3</manvolnum></citerefentry>
103 for more information. The function will return the timestamps for
104 the boot identified by the passed boot ID. Either one of the two
105 timestamp arguments may be passed as <constant>NULL</constant> in
106 case the timestamp is not needed, but not both.</para>
107 </refsect1>
108
109 <refsect1>
110 <title>Return Value</title>
111
112 <para><function>sd_journal_get_cutoff_realtime_usec()</function>
113 and <function>sd_journal_get_cutoff_monotonic_usec()</function>
114 return 1 on success, 0 if not suitable entries are in the journal
115 or a negative errno-style error code.</para>
116
117 <para>Locations pointed to by parameters
118 <parameter>from</parameter> and <parameter>to</parameter> will be
119 set only if the return value is positive, and obviously, the
120 parameters are non-null.</para>
121 </refsect1>
122
123 <refsect1>
124 <title>Notes</title>
125
126 <para>The
127 <function>sd_journal_get_cutoff_realtime_usec()</function> and
128 <function>sd_journal_get_cutoff_monotonic_usec()</function>
129 interfaces are available as a shared library, which can be
130 compiled and linked to with the
131 <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
132 file.</para>
133 </refsect1>
134
135 <refsect1>
136 <title>See Also</title>
137
138 <para>
139 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
140 <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
141 <citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
142 <citerefentry><refentrytitle>sd_journal_get_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
143 <citerefentry><refentrytitle>sd_id128_get_boot</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
144 <citerefentry><refentrytitle>clock_gettime</refentrytitle><manvolnum>2</manvolnum></citerefentry>
145 </para>
146 </refsect1>
147
148 </refentry>