| 1 |
'\" t |
| 2 |
.TH "SD_BUS_MESSAGE_REWIND" "3" "" "systemd 261~rc3" "sd_bus_message_rewind" |
| 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_message_rewind \- Return to beginning of message or current container |
| 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_message_rewind('u |
| 32 |
.BI "int sd_bus_message_rewind(sd_bus_message\ *" "m" ", int\ " "complete" ");" |
| 33 |
.SH "DESCRIPTION" |
| 34 |
.PP |
| 35 |
\fBsd_bus_message_rewind()\fR |
| 36 |
moves the "read pointer" in the message |
| 37 |
\fIm\fR |
| 38 |
to either the beginning of the message (if |
| 39 |
\fIcomplete\fR |
| 40 |
is true) or to the beginning of the currently open container\&. If no container is open, |
| 41 |
\fIcomplete\fR |
| 42 |
has no effect\&. |
| 43 |
.SH "RETURN VALUE" |
| 44 |
.PP |
| 45 |
On success, this function returns 0 or a positive integer\&. The value is zero if the current container or whole message in case no container is open is empty, and positive otherwise\&. On failure, it returns a negative errno\-style error code\&. |
| 46 |
.SS "Errors" |
| 47 |
.PP |
| 48 |
Returned errors may indicate the following problems: |
| 49 |
.PP |
| 50 |
\fB\-EINVAL\fR |
| 51 |
.RS 4 |
| 52 |
The |
| 53 |
\fIm\fR |
| 54 |
parameter is |
| 55 |
\fBNULL\fR\&. |
| 56 |
.RE |
| 57 |
.PP |
| 58 |
\fB\-EPERM\fR |
| 59 |
.RS 4 |
| 60 |
The message |
| 61 |
\fIm\fR |
| 62 |
has not been sealed\&. |
| 63 |
.RE |
| 64 |
.SH "NOTES" |
| 65 |
.PP |
| 66 |
Functions described here are available as a shared library, which can be compiled against and linked to with the |
| 67 |
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1) |
| 68 |
file\&. |
| 69 |
.PP |
| 70 |
The code described here uses |
| 71 |
\fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call |
| 72 |
\fBsetenv\fR(3) |
| 73 |
from a parallel thread\&. It is recommended to only do calls to |
| 74 |
\fBsetenv()\fR |
| 75 |
from an early phase of the program when no other threads have been started\&. |
| 76 |
.SH "HISTORY" |
| 77 |
.PP |
| 78 |
\fBsd_bus_message_rewind()\fR |
| 79 |
was added in version 240\&. |
| 80 |
.SH "SEE ALSO" |
| 81 |
.PP |
| 82 |
\fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_message_read\fR(3) |