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, library
43 or module instance.
44
45 -EPERM
46 The specified bus connection object is a not a direct but a
47 brokered connection.
48
50 Functions described here are available as a shared library, which can
51 be compiled against and linked to with the libsystemd pkg-config(1)
52 file.
53
54 The code described here uses getenv(3), which is declared to be not
55 multi-thread-safe. This means that the code calling the functions
56 described here must not call setenv(3) from a parallel thread. It is
57 recommended to only do calls to setenv() from an early phase of the
58 program when no other threads have been started.
59
61 systemd(1), sd-bus(3), sd_bus_message_set_sender(3)
62
63
64
65systemd 254 SD_BUS_SET_SENDER(3)