man-pages/man3/sd_bus_message_append_string_memfd.3.html
2021-03-31 01:06:50 +01:00

210 lines
4.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_MESSAGE_APPEND_STRING_MEMFD</TITLE>
</HEAD><BODY>
<H1>SD_BUS_MESSAGE_APPEND_STRING_MEMFD</H1>
Section: sd_bus_message_append_string_memfd (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_message_append_string_memfd, sd_bus_message_append_string_iovec, sd_bus_message_append_string_space - Attach a string to a message
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_bus_message_append_string_memfd(sd_bus_message&nbsp;*</B><I>m</I><B>, int&nbsp;</B><I>memfd</I><B>);</B>
<DT id="2">
<B>int sd_bus_message_append_string_iovec(sd_bus_message&nbsp;*</B><I>m</I><B>, const&nbsp;struct&nbsp;iovec&nbsp;*</B><I>iov</I><B>, unsigned&nbsp;</B><I>n</I><B>);</B>
<DT id="3">
<B>int sd_bus_message_append_string_space(sd_bus_message&nbsp;*</B><I>m</I><B>, size_t&nbsp;</B><I>size</I><B>, char&nbsp;**</B><I>s</I><B>);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<DD>The functions
<B>sd_bus_message_append_string_memfd</B>
and
<B>sd_bus_message_append_string_iovec</B>
can be used to append a single string (item of type
&quot;s&quot;) to message
<I>m</I>.
<P>
In case of
<B>sd_bus_message_append_string_memfd</B>, the contents of
<I>memfd</I>
are the string. They must satisfy the same constraints as described for the
&quot;s&quot;
type in
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_append_basic">sd_bus_message_append_basic</A></B>(3).
<P>
In case of
<B>sd_bus_message_append_string_iovec</B>, the payload of
<I>iov</I>
is the string. It must satisfy the same constraints as described for the
&quot;s&quot;
type in
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_append_basic">sd_bus_message_append_basic</A></B>(3).
<P>
The
<I>iov</I>
argument must point to
<I>n</I>
struct iovec
structures. Each structure may have the
iov_base
field set, in which case the memory pointed to will be copied into the message, or unset, in which case a block of spaces (ASCII 32) of length
iov_len
will be inserted. The memory pointed at by
<I>iov</I>
may be changed after this call.
<P>
The
<B>sd_bus_message_append_string_space</B>
function appends space for a string to message
<I>m</I>. It behaves similar to
<B>sd_bus_message_append_basic</B>
with type
&quot;s&quot;, but instead of copying a string into the message, it returns a pointer to the destination area to the caller in pointer
<I>p</I>. Space for the string of length
<I>size</I>
plus the terminating
<B>NUL</B>
is allocated.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On success, those calls return 0 or a positive integer. On failure, they return a negative errno-style error code.
<A NAME="lbAF">&nbsp;</A>
<H3>Errors</H3>
<P>
Returned errors may indicate the following problems:
<P>
<B>-EINVAL</B>
<DL COMPACT><DT id="4"><DD>
Specified parameter is invalid.
</DL>
<P>
<B>-EPERM</B>
<DL COMPACT><DT id="5"><DD>
Message has been sealed.
</DL>
<P>
<B>-ESTALE</B>
<DL COMPACT><DT id="6"><DD>
Message is in invalid state.
</DL>
<P>
<B>-ENXIO</B>
<DL COMPACT><DT id="7"><DD>
Message cannot be appended to.
</DL>
<P>
<B>-ENOMEM</B>
<DL COMPACT><DT id="8"><DD>
Memory allocation failed.
</DL>
<A NAME="lbAG">&nbsp;</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>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<A NAME="lbAH">&nbsp;</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_message_append_basic">sd_bus_message_append_basic</A></B>(3),
m[blue]<B>The D-Bus specification</B>m[]<FONT SIZE="-2">[1]</FONT>
<A NAME="lbAI">&nbsp;</A>
<H2>NOTES</H2>
<DL COMPACT>
<DT id="9"> 1.<DD>
The D-Bus specification
<DL COMPACT><DT id="10"><DD>
<A HREF="http://dbus.freedesktop.org/doc/dbus-specification.html">http://dbus.freedesktop.org/doc/dbus-specification.html</A>
</DL>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="11"><A HREF="#lbAB">NAME</A><DD>
<DT id="12"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="13"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="14"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DL>
<DT id="15"><A HREF="#lbAF">Errors</A><DD>
</DL>
<DT id="16"><A HREF="#lbAG">NOTES</A><DD>
<DT id="17"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="18"><A HREF="#lbAI">NOTES</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>