| 1 |
'\" t |
| 2 |
.TH "SD_BUS_GET_N_QUEUED_READ" "3" "" "systemd 261~rc3" "sd_bus_get_fd" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
sd_bus_get_n_queued_read, sd_bus_get_n_queued_write \- Get the number of pending bus messages in the read and write queues of a bus connection object |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.sp |
| 26 |
.ft B |
| 27 |
.nf |
| 28 |
#include <systemd/sd\-bus\&.h> |
| 29 |
.fi |
| 30 |
.ft |
| 31 |
.HP \w'int\ sd_bus_get_n_queued_read('u |
| 32 |
.BI "int sd_bus_get_n_queued_read(sd_bus\ *" "bus" ", uint64_t\ *" "ret" ");" |
| 33 |
.HP \w'int\ sd_bus_get_n_queued_write('u |
| 34 |
.BI "int sd_bus_get_n_queued_write(sd_bus\ *" "bus" ", uint64_t\ *" "ret" ");" |
| 35 |
.SH "DESCRIPTION" |
| 36 |
.PP |
| 37 |
\fBsd_bus_get_n_queued_read()\fR |
| 38 |
may be used to query the number of bus messages in the read queue of a bus connection object\&. The read queue contains all messages read from the transport medium (e\&.g\&. network socket) but not yet processed locally\&. The function expects two arguments: the bus object to query, and a pointer to a 64\-bit counter variable to write the current queue size to\&. Use |
| 39 |
\fBsd_bus_process()\fR |
| 40 |
in order to process queued messages, i\&.e\&. to reduce the size of the read queue (as well as, in fact, the write queue, see below)\&. |
| 41 |
.PP |
| 42 |
Similarly, |
| 43 |
\fBsd_bus_get_n_queued_write()\fR |
| 44 |
may be used to query the number of currently pending bus messages in the write queue of a bus connection object\&. The write queue contains all messages enqueued into the connection with a call such as |
| 45 |
\fBsd_bus_send()\fR |
| 46 |
but not yet written to the transport medium\&. The expected arguments are similar to |
| 47 |
\fBsd_bus_get_n_queued_read()\fR\&. Here too, use |
| 48 |
\fBsd_bus_process()\fR |
| 49 |
to reduce the size of the write queue\&. Alternatively, use |
| 50 |
\fBsd_bus_flush()\fR |
| 51 |
to synchronously write out any pending bus messages until the write queue is empty\&. |
| 52 |
.SH "RETURN VALUE" |
| 53 |
.PP |
| 54 |
On success, these functions return 0 or a positive integer\&. On failure, they return a negative errno\-style error code\&. |
| 55 |
.SS "Errors" |
| 56 |
.PP |
| 57 |
Returned errors may indicate the following problems: |
| 58 |
.PP |
| 59 |
\fB\-ECHILD\fR |
| 60 |
.RS 4 |
| 61 |
The bus connection was created in a different process, library or module instance\&. |
| 62 |
.RE |
| 63 |
.SH "HISTORY" |
| 64 |
.PP |
| 65 |
\fBsd_bus_get_n_queued_read()\fR |
| 66 |
and |
| 67 |
\fBsd_bus_get_n_queued_write()\fR |
| 68 |
were added in version 238\&. |
| 69 |
.SH "SEE ALSO" |
| 70 |
.PP |
| 71 |
\fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_process\fR(3), \fBsd_bus_send\fR(3), \fBsd_bus_flush\fR(3) |