1SD_BUS_GET_N_QUEUED_READ(3) sd_bus_get_fd SD_BUS_GET_N_QUEUED_READ(3)
2
3
4
6 sd_bus_get_n_queued_read, sd_bus_get_n_queued_write - Get the number of
7 pending bus messages in the read and write queues of a bus connection
8 object
9
11 #include <systemd/sd-bus.h>
12
13 int sd_bus_get_n_queued_read(sd_bus *bus, uint64_t *ret);
14
15 int sd_bus_get_n_queued_write(sd_bus *bus, uint64_t *ret);
16
18 sd_bus_get_n_queued_read() may be used to query the number of bus
19 messages in the read queue of a bus connection object. The read queue
20 contains all messages read from the transport medium (e.g. network
21 socket) but not yet processed locally. The function expects two
22 arguments: the bus object to query, and a pointer to a 64bit counter
23 variable to write the current queue size to. Use sd_bus_process() in
24 order to process queued messages, i.e. to reduce the size of the read
25 queue (as well as, in fact, the write queue, see below).
26
27 Similarly, sd_bus_get_n_queued_write() may be used to query the number
28 of currently pending bus messages in the write queue of a bus
29 connection object. The write queue contains all messages enqueued into
30 the connection with a call such as sd_bus_send() but not yet written to
31 the transport medium. The expected arguments are similar to
32 sd_bus_get_n_queued_read(). Here too, use sd_bus_process() to reduce
33 the size of the write queue. Alternatively, use sd_bus_flush() to
34 synchronously write out any pending bus messages until the write queue
35 is empty.
36
38 On success, these functions return 0 or a positive integer. On failure,
39 they return a negative errno-style error code.
40
41 Errors
42 Returned errors may indicate the following problems:
43
44 -ECHILD
45 The bus connection was created in a different process.
46
48 systemd(1), sd-bus(3), sd_bus_process(3), sd_bus_send(3),
49 sd_bus_flush(3)
50
51
52
53systemd 243 SD_BUS_GET_N_QUEUED_READ(3)