]> git.proxmox.com Git - systemd.git/blame - man/sd_journal_get_realtime_usec.3
Imported Upstream version 219
[systemd.git] / man / sd_journal_get_realtime_usec.3
CommitLineData
14228c0d 1'\" t
e735f4d4 2.TH "SD_JOURNAL_GET_REALTIME_USEC" "3" "" "systemd 219" "sd_journal_get_realtime_usec"
14228c0d
MB
3.\" -----------------------------------------------------------------
4.\" * Define some portability stuff
5.\" -----------------------------------------------------------------
6.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7.\" http://bugs.debian.org/507673
8.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10.ie \n(.g .ds Aq \(aq
11.el .ds Aq '
12.\" -----------------------------------------------------------------
13.\" * set default formatting
14.\" -----------------------------------------------------------------
15.\" disable hyphenation
16.nh
17.\" disable justification (adjust text to left margin only)
18.ad l
19.\" -----------------------------------------------------------------
20.\" * MAIN CONTENT STARTS HERE *
21.\" -----------------------------------------------------------------
22.SH "NAME"
23sd_journal_get_realtime_usec, sd_journal_get_monotonic_usec \- Read timestamps from the current journal entry
24.SH "SYNOPSIS"
25.sp
26.ft B
27.nf
28#include <systemd/sd\-journal\&.h>
29.fi
30.ft
31.HP \w'int\ sd_journal_get_realtime_usec('u
60f067b4 32.BI "int sd_journal_get_realtime_usec(sd_journal\ *" "j" ", uint64_t\ *" "usec" ");"
14228c0d 33.HP \w'int\ sd_journal_get_monotonic_usec('u
60f067b4 34.BI "int sd_journal_get_monotonic_usec(sd_journal\ *" "j" ", uint64_t\ *" "usec" ", sd_id128_t\ *" "boot_id" ");"
14228c0d
MB
35.SH "DESCRIPTION"
36.PP
37\fBsd_journal_get_realtime_usec()\fR
38gets the realtime (wallclock) timestamp of the current journal entry\&. It takes two arguments: the journal context object and a pointer to a 64\-bit unsigned integer to store the timestamp in\&. The timestamp is in microseconds since the epoch, i\&.e\&.
39\fBCLOCK_REALTIME\fR\&.
40.PP
41\fBsd_journal_get_monotonic_usec()\fR
42gets the monotonic timestamp of the current journal entry\&. It takes three arguments: the journal context object, a pointer to a 64\-bit unsigned integer to store the timestamp in, as well as a 128\-bit ID buffer to store the boot ID of the monotonic timestamp\&. The timestamp is in microseconds since boot\-up of the specific boot, i\&.e\&.
43\fBCLOCK_MONOTONIC\fR\&. Since the monotonic clock begins new with every reboot, it only defines a well\-defined point in time when used together with an identifier identifying the boot\&. See
44\fBsd_id128_get_boot\fR(3)
45for more information\&. If the boot ID parameter is passed
46\fBNULL\fR, the function will fail if the monotonic timestamp of the current entry is not of the current system boot\&.
47.PP
48Note that these functions will not work before
49\fBsd_journal_next\fR(3)
50(or related call) has been called at least once, in order to position the read pointer at a valid entry\&.
51.SH "RETURN VALUE"
52.PP
53\fBsd_journal_get_realtime_usec()\fR
54and
55\fBsd_journal_get_monotonic_usec()\fR
56returns 0 on success or a negative errno\-style error code\&. If the boot ID parameter was passed
57\fBNULL\fR
e735f4d4
MP
58and the monotonic timestamp of the current journal entry is not of the current system boot,
59\fB\-ESTALE\fR
60is returned by
14228c0d
MB
61\fBsd_journal_get_monotonic_usec()\fR\&.
62.SH "NOTES"
63.PP
64The
65\fBsd_journal_get_realtime_usec()\fR
66and
67\fBsd_journal_get_monotonic_usec()\fR
60f067b4
JS
68interfaces are available as a shared library, which can be compiled and linked to with the
69\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
14228c0d
MB
70file\&.
71.SH "SEE ALSO"
72.PP
73\fBsystemd\fR(1),
74\fBsd-journal\fR(3),
75\fBsd_journal_open\fR(3),
76\fBsd_journal_next\fR(3),
77\fBsd_journal_get_data\fR(3),
78\fBsd_id128_get_boot\fR(3),
79\fBclock_gettime\fR(2),
80\fBsd_journal_get_cutoff_realtime_usec\fR(3)