Debian Codegraph @

upstream/debian-unstable/man3/sd_bus_set_sender.3

raw
1 '\" t
2 .TH "SD_BUS_SET_SENDER" "3" "" "systemd 261~rc3" "sd_bus_set_sender"
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_set_sender, sd_bus_get_sender \- Configure default sender for outgoing messages
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_set_sender('u
32 .BI "int sd_bus_set_sender(sd_bus\ *" "bus" ", const\ char*\ " "name" ");"
33 .HP \w'int\ sd_bus_get_sender('u
34 .BI "int sd_bus_get_sender(sd_bus\ *" "bus" ", const\ char**\ " "name" ");"
35 .SH "DESCRIPTION"
36 .PP
37 \fBsd_bus_set_sender()\fR
38 configures the default sender service name to use for outgoing messages\&. The service name specified in the
39 \fIname\fR
40 parameter is set on all outgoing messages that are sent on the connection and have no sender set yet, for example through
41 \fBsd_bus_message_set_sender\fR(3)\&. Note that this function is only supported on direct connections, i\&.e\&. not on connections to a bus broker as the broker will fill in the sender service name automatically anyway\&. By default, no sender name is configured, and hence messages are sent without sender field set\&. If the
42 \fIname\fR
43 parameter is specified as
44 \fBNULL\fR
45 the default sender service name is cleared, returning to the default state if a default sender service name was set before\&. If passed as non\-\fBNULL\fR
46 the specified name must be a valid unique or well\-known service name\&.
47 .PP
48 \fBsd_bus_get_sender()\fR
49 may be used to query the current default service name for outgoing messages\&.
50 .SH "RETURN VALUE"
51 .PP
52 On success, these functions return 0 or a positive integer\&. On failure, they return a negative errno\-style error code\&.
53 .SS "Errors"
54 .PP
55 Returned errors may indicate the following problems:
56 .PP
57 \fB\-ECHILD\fR
58 .RS 4
59 The bus connection has been created in a different process, library or module instance\&.
60 .RE
61 .PP
62 \fB\-EPERM\fR
63 .RS 4
64 The specified bus connection object is a not a direct but a brokered connection\&.
65 .RE
66 .SH "NOTES"
67 .PP
68 Functions described here are available as a shared library, which can be compiled against and linked to with the
69 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
70 file\&.
71 .PP
72 The code described here uses
73 \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
74 \fBsetenv\fR(3)
75 from a parallel thread\&. It is recommended to only do calls to
76 \fBsetenv()\fR
77 from an early phase of the program when no other threads have been started\&.
78 .SH "HISTORY"
79 .PP
80 \fBsd_bus_set_sender()\fR
81 and
82 \fBsd_bus_get_sender()\fR
83 were added in version 237\&.
84 .SH "SEE ALSO"
85 .PP
86 \fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_message_set_sender\fR(3)