---
name: "sd_journal_has_runtime_files"
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_has_runtime_files"
---

# sd\_journal\_has\_runtime\_files(3)

Query availability of runtime or persistent journal files

## NAME

sd\_journal\_has\_runtime\_files, sd\_journal\_has\_persistent\_files - Query availability of runtime or persistent journal files

## SYNOPSIS

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

**int sd\_journal\_has\_runtime\_files(sd\_journal \****j***);**

**int sd\_journal\_has\_persistent\_files(sd\_journal \****j***);**

## DESCRIPTION

**sd\_journal\_has\_runtime\_files()** returns a positive value if runtime journal files (present in /run/systemd/journal/) have been found. Otherwise, returns 0.

**sd\_journal\_has\_persistent\_files()** returns a positive value if persistent journal files (present in /var/log/journal/) have been found. Otherwise, returns 0.

## RETURN VALUE

Both **sd\_journal\_has\_runtime\_files()** and **sd\_journal\_has\_persistent\_files()** return -EINVAL if their argument is **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\_has\_runtime\_files()** and **sd\_journal\_has\_persistent\_files()** were added in version 229.

## SEE ALSO

[**systemd**(1)](/systemd/1.md), [**sd-journal**(3)](/sd-journal/3.md)
