2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
9 <refentry id=
"sd_bus_get_n_queued_read">
12 <title>sd_bus_get_fd
</title>
13 <productname>systemd
</productname>
17 <refentrytitle>sd_bus_get_n_queued_read
</refentrytitle>
18 <manvolnum>3</manvolnum>
22 <refname>sd_bus_get_n_queued_read
</refname>
23 <refname>sd_bus_get_n_queued_write
</refname>
25 <refpurpose>Get the number of pending bus messages in the read and write queues of a bus connection object
</refpurpose>
30 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
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>
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>
47 <title>Description
</title>
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
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
59 Similarly,
<function>sd_bus_get_n_queued_write()
</function> may be used to query the number of currently pending
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
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
64 <function>sd_bus_flush()
</function> to synchronously write out any pending bus messages until the write queue is
70 <title>Return Value
</title>
72 <para>On success, these functions return
0 or a positive integer. On failure, they return a negative errno-style
79 <para>Returned errors may indicate the following problems:
</para>
83 <term><constant>-ECHILD
</constant></term>
85 <listitem><para>The bus connection was created in a different process.
</para></listitem>
92 <title>See Also
</title>
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>