]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_process.xml
man: drop mode line in file headers
[thirdparty/systemd.git] / man / sd_bus_process.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
e382c49f 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
96b2fb93 8 Copyright © 2016 Julian Orth
e382c49f 9-->
10
11<refentry id="sd_bus_process">
12
13 <refentryinfo>
14 <title>sd_bus_process</title>
15 <productname>systemd</productname>
e382c49f 16 </refentryinfo>
17
18 <refmeta>
19 <refentrytitle>sd_bus_process</refentrytitle>
20 <manvolnum>3</manvolnum>
21 </refmeta>
22
23 <refnamediv>
24 <refname>sd_bus_process</refname>
25
26 <refpurpose>Drive the connection</refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
30 <funcsynopsis>
31 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
32
33 <funcprototype>
34 <funcdef>int <function>sd_bus_process</function></funcdef>
35 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
36 <paramdef>sd_bus_message **<parameter>r</parameter></paramdef>
37 </funcprototype>
38 </funcsynopsis>
39 </refsynopsisdiv>
40
41 <refsect1>
42 <title>Description</title>
43
44 <para>
45 <function>sd_bus_process()</function> drives the connection between the
46 message bus and the client. That is, it handles connecting,
47 authentication, and message processing. It should be called in a loop
48 until no further progress can be made or an error occurs.
49 </para>
50
51 <para>
52 Once no further progress can be made,
53 <citerefentry><refentrytitle>sd_bus_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>
54 should be called. Alternatively the user can wait for incoming data on
55 the file descriptor returned by
56 <citerefentry><refentrytitle>sd_bus_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
57 </para>
58
59 <para>
60 <function>sd_bus_process</function> processes at most one incoming
61 message per call. If the parameter <parameter>r</parameter> is not NULL
62 and the call processed a message, <code>*r</code> is set to this message.
63 The caller owns a reference to this message and should call
64 <citerefentry><refentrytitle>sd_bus_message_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
65 when the message is no longer needed. If <parameter>r</parameter> is not
66 NULL, progress was made, but no message was processed, <code>*r</code> is
67 set to NULL.
68 </para>
69 </refsect1>
70
71 <refsect1>
72 <title>Return Value</title>
73
74 <para>
75 If progress was made, a positive integer is returned. If no progress was
76 made, 0 is returned. If an error occurs, a negative errno-style error code
77 is returned.
78 </para>
79 </refsect1>
80
81 <refsect1>
82 <title>See Also</title>
83
84 <para>
85 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
86 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
87 </para>
88 </refsect1>
89
90</refentry>