---
name: "sd_journal_get_cutoff_monotonic_usec"
section: "3"
platform: "linux"
package: "libsystemd-dev"
version: "257.13-1~deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/sd_journal_get_cutoff_realtime_usec"
---

# sd\_journal\_get\_cutoff\_monotonic\_usec(3)

Read cut-off timestamps from the current journal entry

Part of [sd\_journal\_get\_cutoff\_realtime\_usec(3)](/sd_journal_get_cutoff_realtime_usec/3.md).

## NAME

sd\_journal\_get\_cutoff\_realtime\_usec, sd\_journal\_get\_cutoff\_monotonic\_usec - Read cut-off timestamps from the current journal entry

## SYNOPSIS

```
#include <systemd/sd-journal.h>
```

**int sd\_journal\_get\_cutoff\_realtime\_usec(sd\_journal \****j***, uint64\_t \****from***, uint64\_t \****to***);**

**int sd\_journal\_get\_cutoff\_monotonic\_usec(sd\_journal \****j***, sd\_id128\_t** *boot\_id***, uint64\_t \****from***, uint64\_t \****to***);**

## DESCRIPTION

**sd\_journal\_get\_cutoff\_realtime\_usec()** retrieves the realtime (wallclock) timestamps of the first and last entries accessible in the journal. It takes three arguments: the journal context object *j* and two pointers *from* and *to* pointing at 64-bit unsigned integers to store the timestamps in. The timestamps are in microseconds since the epoch, i.e. **CLOCK\_REALTIME**. Either one of the two timestamp arguments may be passed as **NULL** in case the timestamp is not needed, but not both.

**sd\_journal\_get\_cutoff\_monotonic\_usec()** retrieves the monotonic timestamps of the first and last entries accessible in the journal. It takes three arguments: the journal context object *j*, a 128-bit identifier for the boot *boot\_id*, and two pointers to 64-bit unsigned integers to store the timestamps, *from* and *to*. The timestamps are in microseconds since boot-up of the specific boot, i.e. **CLOCK\_MONOTONIC**. 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 [**sd\_id128\_get\_boot**(3)](/sd_id128_get_boot/3.md) 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 **NULL** in case the timestamp is not needed, but not both.

## RETURN VALUE

**sd\_journal\_get\_cutoff\_realtime\_usec()** and **sd\_journal\_get\_cutoff\_monotonic\_usec()** return 1 on success, 0 if not suitable entries are in the journal or a negative errno-style error code.

Locations pointed to by parameters *from* and *to* will be set only if the return value is positive, and obviously, the parameters are non-null.

## NOTES

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.

Functions described here are available as a shared library, which can be compiled against and linked to with the **libsystemd** [**pkg-config**(1)](/pkg-config/1.md) file.

## HISTORY

**sd\_journal\_get\_cutoff\_realtime\_usec()** and **sd\_journal\_get\_cutoff\_monotonic\_usec()** were added in version 187.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-journal**(3)](/sd-journal/3.md), [**sd\_journal\_open**(3)](/sd_journal_open/3.md), [**sd\_journal\_get\_realtime\_usec**(3)](/sd_journal_get_realtime_usec/3.md), [**sd\_id128\_get\_boot**(3)](/sd_id128_get_boot/3.md), [**clock\_gettime**(2)](/clock_gettime/2.md)
