]>
Commit | Line | Data |
---|---|---|
514094f9 | 1 | <?xml version='1.0'?> |
2770da02 LP |
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+ | |
2770da02 LP |
7 | --> |
8 | ||
9 | <refentry id="sd_bus_get_n_queued_read"> | |
10 | ||
11 | <refentryinfo> | |
12 | <title>sd_bus_get_fd</title> | |
13 | <productname>systemd</productname> | |
2770da02 LP |
14 | </refentryinfo> |
15 | ||
16 | <refmeta> | |
17 | <refentrytitle>sd_bus_get_n_queued_read</refentrytitle> | |
18 | <manvolnum>3</manvolnum> | |
19 | </refmeta> | |
20 | ||
21 | <refnamediv> | |
22 | <refname>sd_bus_get_n_queued_read</refname> | |
23 | <refname>sd_bus_get_n_queued_write</refname> | |
24 | ||
25 | <refpurpose>Get the number of pending bus messages in the read and write queues of a bus connection object</refpurpose> | |
26 | </refnamediv> | |
27 | ||
28 | <refsynopsisdiv> | |
29 | <funcsynopsis> | |
30 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
31 | ||
32 | <funcprototype> | |
33 | <funcdef>int <function>sd_bus_get_n_queued_read</function></funcdef> | |
34 | <paramdef>sd_bus *<parameter>bus</parameter></paramdef> | |
35 | <paramdef>uint64_t *<parameter>ret</parameter></paramdef> | |
36 | </funcprototype> | |
37 | ||
38 | <funcprototype> | |
39 | <funcdef>int <function>sd_bus_get_n_queued_write</function></funcdef> | |
40 | <paramdef>sd_bus *<parameter>bus</parameter></paramdef> | |
41 | <paramdef>uint64_t *<parameter>ret</parameter></paramdef> | |
42 | </funcprototype> | |
43 | </funcsynopsis> | |
44 | </refsynopsisdiv> | |
45 | ||
46 | <refsect1> | |
47 | <title>Description</title> | |
48 | ||
49 | <para> | |
50 | <function>sd_bus_get_n_queued_read()</function> may be used to query the number of bus messages in the read queue | |
51 | of a bus connection object. The read queue contains all messages read from the transport medium (e.g. network | |
34fd5f69 ZJS |
52 | socket) but not yet processed locally. The function expects two arguments: the bus object to query, and a pointer |
53 | to a 64bit counter variable to write the current queue size to. Use <function>sd_bus_process()</function> in | |
54 | order to process queued messages, i.e. to reduce the size of the read queue (as well as, in fact, the write | |
55 | queue, see below). | |
2770da02 LP |
56 | </para> |
57 | ||
58 | <para> | |
34fd5f69 | 59 | Similarly, <function>sd_bus_get_n_queued_write()</function> may be used to query the number of currently pending |
2770da02 LP |
60 | bus messages in the write queue of a bus connection object. The write queue contains all messages enqueued into |
61 | the connection with a call such as <function>sd_bus_send()</function> but not yet written to the transport | |
34fd5f69 ZJS |
62 | medium. The expected arguments are similar to <function>sd_bus_get_n_queued_read()</function>. Here too, use |
63 | <function>sd_bus_process()</function> to reduce the size of the write queue. Alternatively, use | |
2770da02 LP |
64 | <function>sd_bus_flush()</function> to synchronously write out any pending bus messages until the write queue is |
65 | empty. | |
66 | </para> | |
67 | </refsect1> | |
68 | ||
69 | <refsect1> | |
70 | <title>Return Value</title> | |
71 | ||
72 | <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style | |
73 | error code.</para> | |
74 | </refsect1> | |
75 | ||
76 | <refsect1> | |
77 | <title>Errors</title> | |
78 | ||
79 | <para>Returned errors may indicate the following problems:</para> | |
80 | ||
81 | <variablelist> | |
82 | <varlistentry> | |
83 | <term><constant>-ECHILD</constant></term> | |
84 | ||
34fd5f69 | 85 | <listitem><para>The bus connection was created in a different process.</para></listitem> |
2770da02 LP |
86 | </varlistentry> |
87 | ||
88 | </variablelist> | |
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 | <citerefentry><refentrytitle>sd_bus_process</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
98 | <citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
99 | <citerefentry><refentrytitle>sd_bus_flush</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
100 | </para> | |
101 | </refsect1> | |
102 | ||
103 | </refentry> |