]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_get_n_queued_read.xml
Merge pull request #8676 from keszybz/drop-license-boilerplate
[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 This file is part of systemd.
9
10 Copyright 2018 Lennart Poettering
11 -->
12
13 <refentry id="sd_bus_get_n_queued_read">
14
15 <refentryinfo>
16 <title>sd_bus_get_fd</title>
17 <productname>systemd</productname>
18
19 <authorgroup>
20 <author>
21 <contrib>Developer</contrib>
22 <firstname>Lennart</firstname>
23 <surname>Poettering</surname>
24 <email>lennart@poettering.net</email>
25 </author>
26 </authorgroup>
27 </refentryinfo>
28
29 <refmeta>
30 <refentrytitle>sd_bus_get_n_queued_read</refentrytitle>
31 <manvolnum>3</manvolnum>
32 </refmeta>
33
34 <refnamediv>
35 <refname>sd_bus_get_n_queued_read</refname>
36 <refname>sd_bus_get_n_queued_write</refname>
37
38 <refpurpose>Get the number of pending bus messages in the read and write queues of a bus connection object</refpurpose>
39 </refnamediv>
40
41 <refsynopsisdiv>
42 <funcsynopsis>
43 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
44
45 <funcprototype>
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>
49 </funcprototype>
50
51 <funcprototype>
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>
55 </funcprototype>
56 </funcsynopsis>
57 </refsynopsisdiv>
58
59 <refsect1>
60 <title>Description</title>
61
62 <para>
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
68 queue, see below).
69 </para>
70
71 <para>
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
78 empty.
79 </para>
80 </refsect1>
81
82 <refsect1>
83 <title>Return Value</title>
84
85 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
86 error code.</para>
87 </refsect1>
88
89 <refsect1>
90 <title>Errors</title>
91
92 <para>Returned errors may indicate the following problems:</para>
93
94 <variablelist>
95 <varlistentry>
96 <term><constant>-ECHILD</constant></term>
97
98 <listitem><para>The bus connection was created in a different process.</para></listitem>
99 </varlistentry>
100
101 </variablelist>
102 </refsect1>
103
104 <refsect1>
105 <title>See Also</title>
106
107 <para>
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>
113 </para>
114 </refsect1>
115
116 </refentry>