1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
8 This file is part of systemd.
10 Copyright 2012 Lennart Poettering
13 <refentry id=
"sd_journal_get_usage">
16 <title>sd_journal_get_usage
</title>
17 <productname>systemd
</productname>
21 <contrib>Developer
</contrib>
22 <firstname>Lennart
</firstname>
23 <surname>Poettering
</surname>
24 <email>lennart@poettering.net
</email>
30 <refentrytitle>sd_journal_get_usage
</refentrytitle>
31 <manvolnum>3</manvolnum>
35 <refname>sd_journal_get_usage
</refname>
36 <refpurpose>Journal disk usage
</refpurpose>
41 <funcsynopsisinfo>#include
<systemd/sd-journal.h
></funcsynopsisinfo>
44 <funcdef>int
<function>sd_journal_get_usage
</function></funcdef>
45 <paramdef>sd_journal *
<parameter>j
</parameter></paramdef>
46 <paramdef>uint64_t *
<parameter>bytes
</parameter></paramdef>
53 <title>Description
</title>
55 <para><function>sd_journal_get_usage()
</function> determines the
56 total disk space currently used by journal files (in bytes). If
57 <constant>SD_JOURNAL_LOCAL_ONLY
</constant> was passed when opening
58 the journal, this value will only reflect the size of journal
59 files of the local host, otherwise of all hosts.
</para>
63 <title>Return Value
</title>
65 <para><function>sd_journal_get_usage()
</function> returns
0 on
66 success or a negative errno-style error code.
</para>
72 <para>All functions listed here are thread-agnostic and only a single thread may operate
73 on a given
<structname>sd_journal
</structname> object.
</para>
75 <para>The
<function>sd_journal_get_usage()
</function> interface is
76 available as a shared library, which can be compiled and linked to
78 <constant>libsystemd
</constant> <citerefentry project='die-net'
><refentrytitle>pkg-config
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
83 <title>See Also
</title>
86 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
87 <citerefentry><refentrytitle>sd-journal
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
88 <citerefentry><refentrytitle>sd_journal_open
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,