]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_message_rewind.xml
Merge pull request #8822 from fbuihuu/rfc-tmpfiles-safe-upstream
[thirdparty/systemd.git] / man / sd_bus_message_rewind.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
5
6 <refentry id="sd_bus_message_rewind"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>sd_bus_message_rewind</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>sd_bus_message_rewind</refentrytitle>
16 <manvolnum>3</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>sd_bus_message_rewind</refname>
21
22 <refpurpose>Return to begining of message or current container</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <funcsynopsis>
27 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
28
29 <funcprototype>
30 <funcdef>int <function>sd_bus_message_rewind</function></funcdef>
31 <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
32 <paramdef>int <parameter>complete</parameter></paramdef>
33 </funcprototype>
34 </funcsynopsis>
35 </refsynopsisdiv>
36
37 <refsect1>
38 <title>Description</title>
39
40 <para><function>sd_bus_message_rewind()</function> moves the "read pointer" in the message
41 <parameter>m</parameter> to either the begining of the message (if
42 <parameter>complete</parameter> is true) or to the beginning of the currently open container. If
43 no container is open, <parameter>complete</parameter> has no effect.</para>
44 </refsect1>
45
46 <refsect1>
47 <title>Return Value</title>
48
49 <para>
50 On success, this function returns 0 or a positive integer. The value is zero if the current
51 container or whole message in case no container is open is empty, and positive otherwise. On
52 failure, it returns a negative errno-style error code.
53 </para>
54 </refsect1>
55
56 <xi:include href="libsystemd-pkgconfig.xml" />
57
58 <refsect1>
59 <title>Errors</title>
60
61 <para>Returned errors may indicate the following problems:</para>
62
63 <variablelist>
64 <varlistentry>
65 <term><constant>-EINVAL</constant></term>
66
67 <listitem><para>The <parameter>m</parameter> parameter is <constant>NULL</constant>.</para></listitem>
68 </varlistentry>
69
70 <varlistentry>
71 <term><constant>-EPERM</constant></term>
72
73 <listitem><para>The message <parameter>m</parameter> has not been sealed.</para></listitem>
74 </varlistentry>
75 </variablelist>
76 </refsect1>
77
78 <refsect1>
79 <title>See Also</title>
80
81 <para>
82 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
83 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
84 <citerefentry><refentrytitle>sd_bus_message_read</refentrytitle><manvolnum>3</manvolnum></citerefentry>
85 </para>
86 </refsect1>
87
88 </refentry>