1SD_BUS_SET_SENDER(3) sd_bus_set_sender SD_BUS_SET_SENDER(3)
2
3
4
6 sd_bus_set_sender, sd_bus_get_sender - Configure default sender for
7 outgoing messages
8
10 #include <systemd/sd-bus.h>
11
12 int sd_bus_set_sender(sd_bus *bus, const char* name);
13
14 int sd_bus_get_sender(sd_bus *bus, const char** name);
15
17 sd_bus_set_sender() configures the default sender service name to use
18 for outgoing messages. The service name specified in the name parameter
19 is set on all outgoing messages that are sent on the connection and
20 have no sender set yet, for example through
21 sd_bus_message_set_sender(3). Note that this function is only supported
22 on direct connections, i.e. not on connections to a bus broker as the
23 broker will fill in the sender service name automatically anyway. By
24 default no sender name is configured, and hence messages are sent
25 without sender field set. If the name parameter is specified as NULL
26 the default sender service name is cleared, returning to the default
27 state if a default sender service name was set before. If passed as
28 non-NULL the specified name must be a valid unique or well-known
29 service name.
30
31 sd_bus_get_sender() may be used to query the current default service
32 name for outgoing messages.
33
35 On success, these functions return 0 or a positive integer. On failure,
36 they return a negative errno-style error code.
37
38 Errors
39 Returned errors may indicate the following problems:
40
41 -ECHILD
42 The bus connection has been created in a different process.
43
44 -EPERM
45 The specified bus connection object is a not a direct but a
46 brokered connection.
47
49 These APIs are implemented as a shared library, which can be compiled
50 and linked to with the libsystemd pkg-config(1) file.
51
53 systemd(1), sd-bus(3), sd_bus_message_set_sender(3)
54
55
56
57systemd 243 SD_BUS_SET_SENDER(3)