]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_get_n_queued_read.xml
tree-wide: drop 'This file is part of systemd' blurb
[thirdparty/systemd.git] / man / sd_bus_get_n_queued_read.xml
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 <!--
6 SPDX-License-Identifier: LGPL-2.1+
7
8 Copyright 2018 Lennart Poettering
9 -->
10
11 <refentry id="sd_bus_get_n_queued_read">
12
13 <refentryinfo>
14 <title>sd_bus_get_fd</title>
15 <productname>systemd</productname>
16
17 <authorgroup>
18 <author>
19 <contrib>Developer</contrib>
20 <firstname>Lennart</firstname>
21 <surname>Poettering</surname>
22 <email>lennart@poettering.net</email>
23 </author>
24 </authorgroup>
25 </refentryinfo>
26
27 <refmeta>
28 <refentrytitle>sd_bus_get_n_queued_read</refentrytitle>
29 <manvolnum>3</manvolnum>
30 </refmeta>
31
32 <refnamediv>
33 <refname>sd_bus_get_n_queued_read</refname>
34 <refname>sd_bus_get_n_queued_write</refname>
35
36 <refpurpose>Get the number of pending bus messages in the read and write queues of a bus connection object</refpurpose>
37 </refnamediv>
38
39 <refsynopsisdiv>
40 <funcsynopsis>
41 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
42
43 <funcprototype>
44 <funcdef>int <function>sd_bus_get_n_queued_read</function></funcdef>
45 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
46 <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
47 </funcprototype>
48
49 <funcprototype>
50 <funcdef>int <function>sd_bus_get_n_queued_write</function></funcdef>
51 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
52 <paramdef>uint64_t *<parameter>ret</parameter></paramdef>
53 </funcprototype>
54 </funcsynopsis>
55 </refsynopsisdiv>
56
57 <refsect1>
58 <title>Description</title>
59
60 <para>
61 <function>sd_bus_get_n_queued_read()</function> may be used to query the number of bus messages in the read queue
62 of a bus connection object. The read queue contains all messages read from the transport medium (e.g. network
63 socket) but not yet processed locally. The function expects two arguments: the bus object to query, and a pointer
64 to a 64bit counter variable to write the current queue size to. Use <function>sd_bus_process()</function> in
65 order to process queued messages, i.e. to reduce the size of the read queue (as well as, in fact, the write
66 queue, see below).
67 </para>
68
69 <para>
70 Similarly, <function>sd_bus_get_n_queued_write()</function> may be used to query the number of currently pending
71 bus messages in the write queue of a bus connection object. The write queue contains all messages enqueued into
72 the connection with a call such as <function>sd_bus_send()</function> but not yet written to the transport
73 medium. The expected arguments are similar to <function>sd_bus_get_n_queued_read()</function>. Here too, use
74 <function>sd_bus_process()</function> to reduce the size of the write queue. Alternatively, use
75 <function>sd_bus_flush()</function> to synchronously write out any pending bus messages until the write queue is
76 empty.
77 </para>
78 </refsect1>
79
80 <refsect1>
81 <title>Return Value</title>
82
83 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
84 error code.</para>
85 </refsect1>
86
87 <refsect1>
88 <title>Errors</title>
89
90 <para>Returned errors may indicate the following problems:</para>
91
92 <variablelist>
93 <varlistentry>
94 <term><constant>-ECHILD</constant></term>
95
96 <listitem><para>The bus connection was created in a different process.</para></listitem>
97 </varlistentry>
98
99 </variablelist>
100 </refsect1>
101
102 <refsect1>
103 <title>See Also</title>
104
105 <para>
106 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
107 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
108 <citerefentry><refentrytitle>sd_bus_process</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
109 <citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
110 <citerefentry><refentrytitle>sd_bus_flush</refentrytitle><manvolnum>3</manvolnum></citerefentry>
111 </para>
112 </refsect1>
113
114 </refentry>