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