1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
'\" t
.TH "SD_BUS_REPLY_METHOD_ERROR" "3" "" "systemd 241" "sd_bus_reply_method_error"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sd_bus_reply_method_error, sd_bus_reply_method_errorf, sd_bus_reply_method_errno, sd_bus_reply_method_errnof \- Reply with an error to a method call
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <systemd/sd\-bus\&.h>
.fi
.ft
.HP \w'int\ sd_bus_reply_method_error('u
.BI "int sd_bus_reply_method_error(sd_bus_message\ *" "call" ", const\ sd_bus_error\ *" "e" ");"
.HP \w'int\ sd_bus_reply_method_errorf('u
.BI "int sd_bus_reply_method_errorf(sd_bus_message\ *" "call" ", const\ char\ *" "name" ", const\ char\ *" "format" ", \&...);"
.HP \w'int\ sd_bus_reply_method_errno('u
.BI "int sd_bus_reply_method_errno(sd_bus_message\ *" "call" ", int\ " "error" ", const\ sd_bus_error\ *" "p" ");"
.HP \w'int\ sd_bus_reply_method_errnof('u
.BI "int sd_bus_reply_method_errnof(sd_bus_message\ *" "call" ", int\ " "error" ", const\ char\ *" "format" ", \&...);"
.SH "DESCRIPTION"
.PP
The
\fBsd_bus_reply_method_error()\fR
function sends an error reply to the
\fIcall\fR
message\&. The error structure
\fIe\fR
specifies the error to send, and is used as described in
\fBsd_bus_message_new_error\fR(3)\&. If no reply is expected to
\fIcall\fR, this function returns success without sending reply\&.
.PP
The
\fBsd_bus_reply_method_errorf()\fR
is to
\fBsd_bus_reply_method_error()\fR
what
\fBsd_bus_message_new_method_errorf()\fR
is to
\fBsd_bus_message_new_method_error()\fR\&.
.PP
The
\fBsd_bus_reply_method_errno()\fR
is to
\fBsd_bus_reply_method_error()\fR
what
\fBsd_bus_message_new_method_errno()\fR
is to
\fBsd_bus_message_new_method_error()\fR\&.
.PP
The
\fBsd_bus_reply_method_errnof()\fR
is to
\fBsd_bus_reply_method_error()\fR
what
\fBsd_bus_message_new_method_errnof()\fR
is to
\fBsd_bus_message_new_method_error()\fR\&.
.SH "RETURN VALUE"
.PP
These functions return 0 if the error reply was successfully sent or if none was expected, and a negative errno\-style error code otherwise\&.
.SH "ERRORS"
.PP
Returned errors may indicate the following problems:
.PP
\fB\-EINVAL\fR
.RS 4
The call message
\fIcall\fR
is
\fBNULL\fR\&.
.sp
Message
\fIcall\fR
is not a method call message\&.
.sp
Message
\fIcall\fR
is not attached to a bus\&.
.sp
The error
\fIerror\fR
parameter to
\fBsd_bus_reply_method_error\fR
is not set, see
\fBsd_bus_error_is_set\fR(3)\&.
.RE
.PP
\fB\-EPERM\fR
.RS 4
Message
\fIcall\fR
has been sealed\&.
.RE
.PP
\fB\-ENOTCONN\fR
.RS 4
The bus to which message
\fIcall\fR
is attached is not connected\&.
.RE
.PP
\fB\-ENOMEM\fR
.RS 4
Memory allocation failed\&.
.RE
.PP
In addition, any error message returned by
\fBsd_bus_send\fR(1)
may be returned\&.
.SH "NOTES"
.PP
These APIs are implemented as a shared library, which can be compiled and linked to with the
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
file\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsd-bus\fR(3),
\fBsd_bus_message_new_method_error\fR(3)
|