---
name: "sd_journal_get_usage"
section: "3"
platform: "linux"
package: "systemd-libs"
version: "262.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/sd_journal_get_usage"
---

# sd\_journal\_get\_usage(3)

Journal disk usage

## NAME

sd\_journal\_get\_usage - Journal disk usage

## SYNOPSIS

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

**int sd\_journal\_get\_usage(sd\_journal \****j***, uint64\_t \****bytes***);**

## DESCRIPTION

**sd\_journal\_get\_usage()** determines the total disk space currently used by journal files (in bytes). If **SD\_JOURNAL\_LOCAL\_ONLY** was passed when opening the journal, this value will only reflect the size of journal files of the local host, otherwise of all hosts.

## RETURN VALUE

**sd\_journal\_get\_usage()** returns 0 on success or a negative errno-style error code.

## 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\_usage()** was added in version 190.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-journal**(3)](/sd-journal/3.md), [**sd\_journal\_open**(3)](/sd_journal_open/3.md)
