166 lines
4.4 KiB
HTML
166 lines
4.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_BUS_ERROR_ADD_MAP</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_BUS_ERROR_ADD_MAP</H1>
|
|
Section: sd_bus_error_add_map (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_bus_error_add_map, sd_bus_error_map, SD_BUS_ERROR_MAP, SD_BUS_ERROR_END - Additional sd-dbus error mappings
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
typedef struct {
|
|
const char *name;
|
|
int code;
|
|
...
|
|
} sd_bus_error_map;
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
<B>SD_BUS_ERROR_MAP(</B><B></B><I>name</I><B>, </B><B></B><I>code</I><B>)</B>
|
|
<P>
|
|
|
|
<B>SD_BUS_ERROR_MAP_END</B>
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>int sd_bus_error_add_map(const sd_bus_map *</B><I>map</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<DD>The
|
|
<B>sd_bus_error_add_map()</B>
|
|
call may be used to register additional mappings for converting D-Bus errors to Linux
|
|
<I>errno</I>-style errors. The mappings defined with this call are consulted by calls such as
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_error_set">sd_bus_error_set</A></B>(3)
|
|
or
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_error_get_errno">sd_bus_error_get_errno</A></B>(3). By default, a number of generic, standardized mappings are known, as documented in
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus-errors">sd-bus-errors</A></B>(3). Use this call to add further, application-specific mappings.
|
|
<P>
|
|
|
|
The function takes a pointer to an array of
|
|
sd_bus_error_map
|
|
structures. A reference to the specified array is added to the lookup tables for error mappings. Note that the structure is not copied, and that it is hence essential that the array stays available and constant during the entire remaining runtime of the process.
|
|
<P>
|
|
|
|
The mapping array should be put together with a series of
|
|
<B>SD_BUS_ERROR_MAP()</B>
|
|
macro invocations that take a literal name string and a (positive)
|
|
<I>errno</I>-style error number. The last entry of the array should be an invocation of the
|
|
<B>SD_BUS_ERROR_MAP_END</B>
|
|
macro. The array should not be put together without use of these two macros.
|
|
<P>
|
|
|
|
Note that the call is idempotent: it is safe to invoke it multiple times with the parameter, which will only add the passed mapping array once.
|
|
<P>
|
|
|
|
Note that the memory allocated by this call is not intended to be freed during the lifetime of the process. It should not be freed explicitly.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_bus_error_add_map()</B>
|
|
returns a positive value when the new array was added to the lookup tables. It returns zero when the same array was already added before. On error, a negative
|
|
<I>errno</I>-style error code is returned. See below for known error codes.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Errors</H3>
|
|
|
|
<P>
|
|
|
|
Returned errors may indicate the following problems:
|
|
<P>
|
|
|
|
<B>-EINVAL</B>
|
|
<DL COMPACT><DT id="2"><DD>
|
|
The specified mapping array is invalid.
|
|
</DL>
|
|
|
|
<P>
|
|
|
|
<B>-ENOMEM</B>
|
|
<DL COMPACT><DT id="3"><DD>
|
|
Memory allocation failed.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
|
|
These APIs are implemented as a shared library, which can be compiled and linked to with the
|
|
<B>libsystemd</B> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_error">sd_bus_error</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus-errors">sd-bus-errors</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+errno">errno</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+strerror_r">strerror_r</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="7"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DL>
|
|
<DT id="8"><A HREF="#lbAF">Errors</A><DD>
|
|
</DL>
|
|
<DT id="9"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="10"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:54 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|