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">
6 SPDX-License-Identifier: LGPL-2.1+
8 This file is part of systemd.
10 Copyright 2018 Lennart Poettering
13 <refentry id=
"sd_bus_get_n_queued_read">
16 <title>sd_bus_get_fd
</title>
17 <productname>systemd
</productname>
21 <contrib>Developer
</contrib>
22 <firstname>Lennart
</firstname>
23 <surname>Poettering
</surname>
24 <email>lennart@poettering.net
</email>
30 <refentrytitle>sd_bus_get_n_queued_read
</refentrytitle>
31 <manvolnum>3</manvolnum>
35 <refname>sd_bus_get_n_queued_read
</refname>
36 <refname>sd_bus_get_n_queued_write
</refname>
38 <refpurpose>Get the number of pending bus messages in the read and write queues of a bus connection object
</refpurpose>
43 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
46 <funcdef>int
<function>sd_bus_get_n_queued_read
</function></funcdef>
47 <paramdef>sd_bus *
<parameter>bus
</parameter></paramdef>
48 <paramdef>uint64_t *
<parameter>ret
</parameter></paramdef>
52 <funcdef>int
<function>sd_bus_get_n_queued_write
</function></funcdef>
53 <paramdef>sd_bus *
<parameter>bus
</parameter></paramdef>
54 <paramdef>uint64_t *
<parameter>ret
</parameter></paramdef>
60 <title>Description
</title>
63 <function>sd_bus_get_n_queued_read()
</function> may be used to query the number of bus messages in the read queue
64 of a bus connection object. The read queue contains all messages read from the transport medium (e.g. network
65 socket) but not yet processed locally. The function expects two arguments: the bus object to query, and a pointer
66 to a
64bit counter variable to write the current queue size to. Use
<function>sd_bus_process()
</function> in
67 order to process queued messages, i.e. to reduce the size of the read queue (as well as, in fact, the write
72 Similarly,
<function>sd_bus_get_n_queued_write()
</function> may be used to query the number of currently pending
73 bus messages in the write queue of a bus connection object. The write queue contains all messages enqueued into
74 the connection with a call such as
<function>sd_bus_send()
</function> but not yet written to the transport
75 medium. The expected arguments are similar to
<function>sd_bus_get_n_queued_read()
</function>. Here too, use
76 <function>sd_bus_process()
</function> to reduce the size of the write queue. Alternatively, use
77 <function>sd_bus_flush()
</function> to synchronously write out any pending bus messages until the write queue is
83 <title>Return Value
</title>
85 <para>On success, these functions return
0 or a positive integer. On failure, they return a negative errno-style
92 <para>Returned errors may indicate the following problems:
</para>
96 <term><constant>-ECHILD
</constant></term>
98 <listitem><para>The bus connection was created in a different process.
</para></listitem>
105 <title>See Also
</title>
108 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
109 <citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
110 <citerefentry><refentrytitle>sd_bus_process
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
111 <citerefentry><refentrytitle>sd_bus_send
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
112 <citerefentry><refentrytitle>sd_bus_flush
</refentrytitle><manvolnum>3</manvolnum></citerefentry>