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 This file is part of systemd.
8 Copyright 2012 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="sd_journal_get_usage">
27 <title>sd_journal_get_usage</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>sd_journal_get_usage</refentrytitle>
42 <manvolnum>3</manvolnum>
46 <refname>sd_journal_get_usage</refname>
47 <refpurpose>Journal disk usage</refpurpose>
52 <funcsynopsisinfo>#include <systemd/sd-journal.h></funcsynopsisinfo>
55 <funcdef>int <function>sd_journal_get_usage</function></funcdef>
56 <paramdef>sd_journal *<parameter>j</parameter></paramdef>
57 <paramdef>uint64_t *<parameter>bytes</parameter></paramdef>
64 <title>Description</title>
66 <para><function>sd_journal_get_usage()</function>
67 determines the total disk space currently used by
68 journal files (in bytes). If
69 <constant>SD_JOURNAL_LOCAL_ONLY</constant> was passed
70 when opening the journal, this value will only reflect
71 the size of journal files of the local host, otherwise
76 <title>Return Value</title>
78 <para><function>sd_journal_get_usage()</function>
79 returns 0 on success or a negative errno-style error
86 <para>The <function>sd_journal_get_usage()</function>
87 interface is available as a shared library, which can be
88 compiled and linked to with the
89 <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
94 <title>See Also</title>
97 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
98 <citerefentry><refentrytitle>sd-journal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
99 <citerefentry><refentrytitle>sd_journal_open</refentrytitle><manvolnum>3</manvolnum></citerefentry>,