diff --git a/man/rules/meson.build b/man/rules/meson.build
index f6786b23ef6..1405c95b61a 100644
--- a/man/rules/meson.build
+++ b/man/rules/meson.build
@@ -291,7 +291,9 @@ manpages = [
''],
['sd_bus_message_get_type',
'3',
- ['sd_bus_message_is_method_call',
+ ['sd_bus_message_get_errno',
+ 'sd_bus_message_get_error',
+ 'sd_bus_message_is_method_call',
'sd_bus_message_is_method_error',
'sd_bus_message_is_signal'],
''],
diff --git a/man/sd-bus.xml b/man/sd-bus.xml
index 958e3d674fb..6b14474f792 100644
--- a/man/sd-bus.xml
+++ b/man/sd-bus.xml
@@ -99,6 +99,8 @@
sd_bus_message_dump3,
sd_bus_message_get_allow_interactive_authorization3,
sd_bus_message_get_cookie3,
+sd_bus_message_get_errno3,
+sd_bus_message_get_error3,
sd_bus_message_get_monotonic_usec3,
sd_bus_message_get_property3,
sd_bus_message_get_property_trivial3,
diff --git a/man/sd_bus_message_get_type.xml b/man/sd_bus_message_get_type.xml
index d8a45ce7a07..7c5e0df6175 100644
--- a/man/sd_bus_message_get_type.xml
+++ b/man/sd_bus_message_get_type.xml
@@ -17,6 +17,8 @@
sd_bus_message_get_type
+ sd_bus_message_get_error
+ sd_bus_message_get_errno
sd_bus_message_is_signal
sd_bus_message_is_method_call
sd_bus_message_is_method_error
@@ -30,27 +32,37 @@
int sd_bus_message_get_type
- sd_bus_message *message
+ sd_bus_message *m
uint8_t *type
+
+ sd_bus_error* sd_bus_message_get_error
+ sd_bus_message *m
+
+
+
+ int sd_bus_message_get_errno
+ sd_bus_message *m
+
+
int sd_bus_message_is_signal
- sd_bus_message *message
+ sd_bus_message *m
const char *interface
const char *member
int sd_bus_message_is_method_call
- sd_bus_message *message
+ sd_bus_message *m
const char *interface
const char *member
int sd_bus_message_is_method_error
- sd_bus_message *message
+ sd_bus_message *m
const char *name
@@ -62,40 +74,52 @@
sd_bus_message_get_type() returns the type of a message in the output
parameter type, one of SD_BUS_MESSAGE_METHOD_CALL,
- SD_BUS_MESSAGE_METHOD_RETURN,
- SD_BUS_MESSAGE_METHOD_ERROR, SD_BUS_MESSAGE_SIGNAL.
- This type is either specified as a parameter when the message is created using
+ SD_BUS_MESSAGE_METHOD_RETURN, SD_BUS_MESSAGE_METHOD_ERROR,
+ SD_BUS_MESSAGE_SIGNAL. This type is either specified as a parameter when the message
+ is created using
sd_bus_set_message_new3,
or is set automatically when the message is created using
sd_bus_set_message_new_signal3,
sd_bus_set_message_new_method_call3,
sd_bus_set_message_new_method_error3
- and similar functions.
+ and similar functions.
+
+ sd_bus_message_get_error() returns the error stored in the message
+ m, if there is any. Otherwise, it returns NULL.
+ sd_bus_message_get_errno() returns the error stored in the message
+ m as a positive errno-style value, if there is any. Otherwise, it returns zero.
+ Errors are mapped to errno values according to the default and any additional registered error mappings.
+ See sd-bus-errors3 and
+ sd_bus_error_add_map3.
- sd_bus_message_is_signal() checks if message m
- is a signal message. If interface is non-null, it also checks if the
- message has the same interface set. If member is non-null, it also checks
- if the message has the same member set. Also see
- sd_bus_set_message_new_signal3. It returns true when all checks pass.
+ sd_bus_message_is_signal() checks if message m is a
+ signal message. If interface is non-null, it also checks if the message has the
+ same interface set. If member is non-null, it also checks if the message has the
+ same member set. Also see
+ sd_bus_set_message_new_signal3.
+ It returns true when all checks pass.
sd_bus_message_is_method_call() checks if message m
- is a method call message. If interface is non-null, it also checks if the
- message has the same interface set. If member is non-null, it also checks
- if the message has the same member set. Also see
- sd_bus_set_message_new_method_call3. It returns true when all checks pass.
+ is a method call message. If interface is non-null, it also checks if the message
+ has the same interface set. If member is non-null, it also checks if the message
+ has the same member set. Also see
+ sd_bus_set_message_new_method_call3.
+ It returns true when all checks pass.
sd_bus_message_is_method_error() checks if message m
- is an error reply message. If name is non-null, it also checks if the
- message has the same error identifier set. Also see
- sd_bus_set_message_new_method_error3. It returns true when all checks pass.
-
+ is an error reply message. If name is non-null, it also checks if the message has
+ the same error identifier set. Also see
+ sd_bus_set_message_new_method_error3.
+ It returns true when all checks pass.
+
Return Value
- On success, those functions return 0 or a positive
- integer. On failure, it returns a negative errno-style error code.
+ On success, these functions return a non-negative integer. On failure, they return a negative
+ errno-style error code. sd_bus_message_get_errno() always returns a non-negative
+ integer, even on failure.
Errors
@@ -106,7 +130,7 @@
-EINVAL
- The message parameter or the output parameter are
+ The message parameter m or an output parameter is
NULL.
@@ -122,7 +146,9 @@
systemd1,
sd-bus3,
sd_bus_message_new3,
- sd_bus_message_set_destination3
+ sd_bus_message_set_destination3,
+ sd-bus-errors3,
+ sd_bus_error_add_map3