chiark / gitweb /
locale-util: on overlayfs FTW_MOUNT causes nftw(3) to not list *any* files
[elogind.git] / man / sd_bus_process.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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 <!--
6   SPDX-License-Identifier: LGPL-2.1+
7
8   This file is part of systemd.
9
10   Copyright 2016 Julian Orth
11 -->
12
13 <refentry id="sd_bus_process">
14
15   <refentryinfo>
16     <title>sd_bus_process</title>
17     <productname>systemd</productname>
18
19     <authorgroup>
20       <author>
21         <firstname>Julian</firstname>
22         <surname>Orth</surname>
23         <email>ju.orth@gmail.com</email>
24       </author>
25     </authorgroup>
26   </refentryinfo>
27
28   <refmeta>
29     <refentrytitle>sd_bus_process</refentrytitle>
30     <manvolnum>3</manvolnum>
31   </refmeta>
32
33   <refnamediv>
34     <refname>sd_bus_process</refname>
35
36     <refpurpose>Drive the connection</refpurpose>
37   </refnamediv>
38
39   <refsynopsisdiv>
40     <funcsynopsis>
41       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
42
43       <funcprototype>
44         <funcdef>int <function>sd_bus_process</function></funcdef>
45         <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
46         <paramdef>sd_bus_message **<parameter>r</parameter></paramdef>
47       </funcprototype>
48     </funcsynopsis>
49   </refsynopsisdiv>
50
51   <refsect1>
52     <title>Description</title>
53
54     <para>
55       <function>sd_bus_process()</function> drives the connection between the
56       message bus and the client. That is, it handles connecting,
57       authentication, and message processing. It should be called in a loop
58       until no further progress can be made or an error occurs.
59     </para>
60
61     <para>
62       Once no further progress can be made,
63       <citerefentry><refentrytitle>sd_bus_wait</refentrytitle><manvolnum>3</manvolnum></citerefentry>
64       should be called. Alternatively the user can wait for incoming data on
65       the file descriptor returned by
66       <citerefentry><refentrytitle>sd_bus_get_fd</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
67     </para>
68
69     <para>
70       <function>sd_bus_process</function> processes at most one incoming
71       message per call.  If the parameter <parameter>r</parameter> is not NULL
72       and the call processed a message, <code>*r</code> is set to this message.
73       The caller owns a reference to this message and should call
74       <citerefentry><refentrytitle>sd_bus_message_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>
75       when the message is no longer needed. If <parameter>r</parameter> is not
76       NULL, progress was made, but no message was processed, <code>*r</code> is
77       set to NULL.
78     </para>
79   </refsect1>
80
81   <refsect1>
82     <title>Return Value</title>
83
84     <para>
85       If progress was made, a positive integer is returned. If no progress was
86       made, 0 is returned. If an error occurs, a negative errno-style error code
87       is returned.
88     </para>
89   </refsect1>
90
91   <refsect1>
92     <title>See Also</title>
93
94     <para>
95       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
96       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
97     </para>
98   </refsect1>
99
100 </refentry>