-<?xml version='1.0'?> <!--*-nxml-*-->
+<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!--
-This file is part of systemd.
+ This file is part of systemd.
-Copyright 2014 Zbigniew Jędrzejewski-Szmek
+ Copyright 2014 Zbigniew Jędrzejewski-Szmek
-systemd is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 2.1 of the License, or
-(at your option) any later version.
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
-systemd is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
-You should have received a copy of the GNU Lesser General Public License
-along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
-->
<refentry id="sd_bus_error" conditional="ENABLE_KDBUS">
<para><function>sd_bus_error_set</function> will return an
errno-like negative value returned based on parameter
<parameter>name</parameter> (see
- <citerefentry><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>).
+ <citerefentry project='man-pages'><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>).
Various well-known D-Bus errors are converted to specific values,
and the remaining ones to <constant>-ENXIO</constant>. Well-known
D-Bus error names are available as constants
<constant>SD_BUS_ERROR_FAILED</constant>, etc., listed above. If
<parameter>name</parameter> is <constant>NULL</constant>, it is
- assumed that no error occured, and 0 is returned. This means that
+ assumed that no error occurred, and 0 is returned. This means that
this function may be conveniently used in a
<function>return</function> statement.</para>
<para><function>sd_bus_error_setf</function> is similar to
<function>sd_bus_error_set</function>, but takes a
- <citerefentry><refentrytitle>printf</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ <citerefentry project='man-pages'><refentrytitle>printf</refentrytitle><manvolnum>3</manvolnum></citerefentry>
format string and corresponding arguments to generate
<structname>message</structname>.</para>
<para><function>sd_bus_error_set_errno</function> will set
<structfield>name</structfield> based on an errno-like value.
- <citerefentry><refentrytitle>strerror</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ <citerefentry project='die-net'><refentrytitle>strerror</refentrytitle><manvolnum>3</manvolnum></citerefentry>
will be used to set <structfield>message</structfield>. Well-known
D-Bus error names will be used for <structfield>name</structfield>
if available, otherwise a name in the
<para><function>sd_bus_error_set_errnof</function> is similar to
<function>sd_bus_error_set_errno</function>, but in addition to
<parameter>name</parameter>, takes a
- <citerefentry><refentrytitle>printf</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ <citerefentry project='man-pages'><refentrytitle>printf</refentrytitle><manvolnum>3</manvolnum></citerefentry>
format and corresponding arguments.
<structfield>name</structfield> will be generated from
<parameter>format</parameter> and the arguments.</para>
- <para><function>sd_bus_error_get_errno</function> is will convert
+ <para><function>sd_bus_error_get_errno</function> will convert
<structname>e->name</structname> to an errno-like value using the
same rules as <function>sd_bus_error_set</function>. If
<parameter>e</parameter> is <constant>NULL</constant>, 0 will be
<para><function>sd_bus_error_free</function> will destroy resources
held by <parameter>e</parameter>. The parameter itself will not
be deallocated, and must be
- <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>d
+ <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>d
by the caller if necessary.</para>
</refsect1>
<variablelist>
<varlistentry>
- <term><varname>-EINVAL</varname></term>
+ <term><constant>-EINVAL</constant></term>
<listitem><para>Error was already set in
<structname>sd_bus_error</structname> structure when one the
</varlistentry>
<varlistentry>
- <term><varname>-ENOMEM</varname></term>
+ <term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
<para><function>sd_bus_set_error()</function> and other functions
described here are available as a shared library, which can be
compiled and linked to with the
- <constant>libsystemd</constant> <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
file.</para>
</refsect1>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>strerror</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ <citerefentry project='man-pages'><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry project='die-net'><refentrytitle>strerror</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>