]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_get_n_queued_read.xml
man: use same version in public and system ident.
[thirdparty/systemd.git] / man / sd_bus_get_n_queued_read.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
eea10b26 3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
db9ecf05 4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
2770da02
LP
5
6<refentry id="sd_bus_get_n_queued_read">
7
8 <refentryinfo>
9 <title>sd_bus_get_fd</title>
10 <productname>systemd</productname>
2770da02
LP
11 </refentryinfo>
12
13 <refmeta>
14 <refentrytitle>sd_bus_get_n_queued_read</refentrytitle>
15 <manvolnum>3</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>sd_bus_get_n_queued_read</refname>
20 <refname>sd_bus_get_n_queued_write</refname>
21
22 <refpurpose>Get the number of pending bus messages in the read and write queues of a bus connection object</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_get_n_queued_read</function></funcdef>
31 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
32 <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
33 </funcprototype>
34
35 <funcprototype>
36 <funcdef>int <function>sd_bus_get_n_queued_write</function></funcdef>
37 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
38 <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
39 </funcprototype>
40 </funcsynopsis>
41 </refsynopsisdiv>
42
43 <refsect1>
44 <title>Description</title>
45
46 <para>
47 <function>sd_bus_get_n_queued_read()</function> may be used to query the number of bus messages in the read queue
48 of a bus connection object. The read queue contains all messages read from the transport medium (e.g. network
34fd5f69 49 socket) but not yet processed locally. The function expects two arguments: the bus object to query, and a pointer
da890466 50 to a 64-bit counter variable to write the current queue size to. Use <function>sd_bus_process()</function> in
34fd5f69
ZJS
51 order to process queued messages, i.e. to reduce the size of the read queue (as well as, in fact, the write
52 queue, see below).
2770da02
LP
53 </para>
54
55 <para>
34fd5f69 56 Similarly, <function>sd_bus_get_n_queued_write()</function> may be used to query the number of currently pending
2770da02
LP
57 bus messages in the write queue of a bus connection object. The write queue contains all messages enqueued into
58 the connection with a call such as <function>sd_bus_send()</function> but not yet written to the transport
34fd5f69
ZJS
59 medium. The expected arguments are similar to <function>sd_bus_get_n_queued_read()</function>. Here too, use
60 <function>sd_bus_process()</function> to reduce the size of the write queue. Alternatively, use
2770da02
LP
61 <function>sd_bus_flush()</function> to synchronously write out any pending bus messages until the write queue is
62 empty.
63 </para>
64 </refsect1>
65
66 <refsect1>
67 <title>Return Value</title>
68
69 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
70 error code.</para>
2770da02 71
b1de39de
ZJS
72 <refsect2>
73 <title>Errors</title>
2770da02 74
b1de39de 75 <para>Returned errors may indicate the following problems:</para>
2770da02 76
b1de39de
ZJS
77 <variablelist>
78 <varlistentry>
79 <term><constant>-ECHILD</constant></term>
2770da02 80
bf876e3f 81 <listitem><para>The bus connection was created in a different process, library or module instance.</para></listitem>
b1de39de 82 </varlistentry>
2770da02 83
b1de39de
ZJS
84 </variablelist>
85 </refsect2>
2770da02
LP
86 </refsect1>
87
69106f47
AK
88 <refsect1>
89 <title>History</title>
00f95506
AK
90 <para><function>sd_bus_get_n_queued_read()</function> and
91 <function>sd_bus_get_n_queued_write()</function> were added in version 238.</para>
69106f47
AK
92 </refsect1>
93
2770da02
LP
94 <refsect1>
95 <title>See Also</title>
96
13a69c12
DT
97 <para><simplelist type="inline">
98 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
99 <member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
100 <member><citerefentry><refentrytitle>sd_bus_process</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
101 <member><citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
102 <member><citerefentry><refentrytitle>sd_bus_flush</refentrytitle><manvolnum>3</manvolnum></citerefentry></member>
103 </simplelist></para>
2770da02
LP
104 </refsect1>
105
106</refentry>