| 1 |
'\" t |
| 2 |
.TH "SD_JOURNAL_GET_CUTOFF_REALTIME_USEC" "3" "" "systemd 261~rc3" "sd_journal_get_cutoff_realtime_usec" |
| 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" |
| 23 |
sd_journal_get_cutoff_realtime_usec, sd_journal_get_cutoff_monotonic_usec \- Read cut\-off 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_cutoff_realtime_usec('u |
| 32 |
.BI "int sd_journal_get_cutoff_realtime_usec(sd_journal\ *" "j" ", uint64_t\ *" "from" ", uint64_t\ *" "to" ");" |
| 33 |
.HP \w'int\ sd_journal_get_cutoff_monotonic_usec('u |
| 34 |
.BI "int sd_journal_get_cutoff_monotonic_usec(sd_journal\ *" "j" ", sd_id128_t\ " "boot_id" ", uint64_t\ *" "from" ", uint64_t\ *" "to" ");" |
| 35 |
.SH "DESCRIPTION" |
| 36 |
.PP |
| 37 |
\fBsd_journal_get_cutoff_realtime_usec()\fR |
| 38 |
retrieves the realtime (wallclock) timestamps of the first and last entries accessible in the journal\&. It takes three arguments: the journal context object |
| 39 |
\fIj\fR |
| 40 |
and two pointers |
| 41 |
\fIfrom\fR |
| 42 |
and |
| 43 |
\fIto\fR |
| 44 |
pointing at 64\-bit unsigned integers to store the timestamps in\&. The timestamps are in microseconds since the epoch, i\&.e\&. |
| 45 |
\fBCLOCK_REALTIME\fR\&. Either one of the two timestamp arguments may be passed as |
| 46 |
\fBNULL\fR |
| 47 |
in case the timestamp is not needed, but not both\&. |
| 48 |
.PP |
| 49 |
\fBsd_journal_get_cutoff_monotonic_usec()\fR |
| 50 |
retrieves the monotonic timestamps of the first and last entries accessible in the journal\&. It takes three arguments: the journal context object |
| 51 |
\fIj\fR, a 128\-bit identifier for the boot |
| 52 |
\fIboot_id\fR, and two pointers to 64\-bit unsigned integers to store the timestamps, |
| 53 |
\fIfrom\fR |
| 54 |
and |
| 55 |
\fIto\fR\&. The timestamps are in microseconds since boot\-up of the specific boot, i\&.e\&. |
| 56 |
\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 |
| 57 |
\fBsd_id128_get_boot\fR(3) |
| 58 |
for more information\&. The function will return the timestamps for the boot identified by the passed boot ID\&. Either one of the two timestamp arguments may be passed as |
| 59 |
\fBNULL\fR |
| 60 |
in case the timestamp is not needed, but not both\&. |
| 61 |
.SH "RETURN VALUE" |
| 62 |
.PP |
| 63 |
\fBsd_journal_get_cutoff_realtime_usec()\fR |
| 64 |
and |
| 65 |
\fBsd_journal_get_cutoff_monotonic_usec()\fR |
| 66 |
return 1 on success, 0 if not suitable entries are in the journal or a negative errno\-style error code\&. |
| 67 |
.PP |
| 68 |
Locations pointed to by parameters |
| 69 |
\fIfrom\fR |
| 70 |
and |
| 71 |
\fIto\fR |
| 72 |
will be set only if the return value is positive, and obviously, the parameters are non\-null\&. |
| 73 |
.SH "NOTES" |
| 74 |
.PP |
| 75 |
All functions listed here are thread\-agnostic and only a single thread may operate on a given object at any given time\&. Different threads may access the same object at different times\&. Multiple independent objects may be used from different threads in parallel\&. |
| 76 |
.PP |
| 77 |
Functions described here are available as a shared library, which can be compiled against and linked to with the |
| 78 |
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1) |
| 79 |
file\&. |
| 80 |
.SH "HISTORY" |
| 81 |
.PP |
| 82 |
\fBsd_journal_get_cutoff_realtime_usec()\fR |
| 83 |
and |
| 84 |
\fBsd_journal_get_cutoff_monotonic_usec()\fR |
| 85 |
were added in version 187\&. |
| 86 |
.SH "SEE ALSO" |
| 87 |
.PP |
| 88 |
\fBsystemd\fR(1), \fBsd-journal\fR(3), \fBsd_journal_open\fR(3), \fBsd_journal_get_realtime_usec\fR(3), \fBsd_id128_get_boot\fR(3), \fBclock_gettime\fR(2) |