1SD_JOURNAL_GET_CUTOFF_RsEdA_LjToIuMrEn_aUlS_EgCe(t3_)cutoSfDf__JrOeUaRlNtAiLm_eG_EuTs_eCcUTOFF_REALTIME_USEC(3)
2
3
4
6 sd_journal_get_cutoff_realtime_usec,
7 sd_journal_get_cutoff_monotonic_usec - Read cut-off timestamps from the
8 current journal entry
9
11 #include <systemd/sd-journal.h>
12
13 int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from,
14 uint64_t *to);
15
16 int sd_journal_get_cutoff_monotonic_usec(sd_journal *j,
17 sd_id128_t boot_id,
18 uint64_t *from, uint64_t *to);
19
21 sd_journal_get_cutoff_realtime_usec() retrieves the realtime
22 (wallclock) timestamps of the first and last entries accessible in the
23 journal. It takes three arguments: the journal context object j and two
24 pointers from and to pointing at 64-bit unsigned integers to store the
25 timestamps in. The timestamps are in microseconds since the epoch, i.e.
26 CLOCK_REALTIME. Either one of the two timestamp arguments may be passed
27 as NULL in case the timestamp is not needed, but not both.
28
29 sd_journal_get_cutoff_monotonic_usec() retrieves the monotonic
30 timestamps of the first and last entries accessible in the journal. It
31 takes three arguments: the journal context object j, a 128-bit
32 identifier for the boot boot_id, and two pointers to 64-bit unsigned
33 integers to store the timestamps, from and to. The timestamps are in
34 microseconds since boot-up of the specific boot, i.e. CLOCK_MONOTONIC.
35 Since the monotonic clock begins new with every reboot it only defines
36 a well-defined point in time when used together with an identifier
37 identifying the boot, see sd_id128_get_boot(3) for more information.
38 The function will return the timestamps for the boot identified by the
39 passed boot ID. Either one of the two timestamp arguments may be passed
40 as NULL in case the timestamp is not needed, but not both.
41
43 sd_journal_get_cutoff_realtime_usec() and
44 sd_journal_get_cutoff_monotonic_usec() return 1 on success, 0 if not
45 suitable entries are in the journal or a negative errno-style error
46 code.
47
48 Locations pointed to by parameters from and to will be set only if the
49 return value is positive, and obviously, the parameters are non-null.
50
52 All functions listed here are thread-agnostic and only a single
53 specific thread may operate on a given object during its entire
54 lifetime. It's safe to allocate multiple independent objects and use
55 each from a specific thread in parallel. However, it's not safe to
56 allocate such an object in one thread, and operate or free it from any
57 other, even if locking is used to ensure these threads don't operate on
58 it at the very same time.
59
60 These APIs are implemented as a shared library, which can be compiled
61 and linked to with the libsystemd pkg-config(1) file.
62
64 systemd(1), sd-journal(3), sd_journal_open(3),
65 sd_journal_get_realtime_usec(3), sd_id128_get_boot(3), clock_gettime(2)
66
67
68
69systemd 253 SD_JOURNAL_GET_CUTOFF_REALTIME_USEC(3)