Debian Codegraph @

upstream/debian-unstable/man3/sd_bus_set_connected_signal.3

raw
1 '\" t
2 .TH "SD_BUS_SET_CONNECTED_SIGNAL" "3" "" "systemd 261~rc3" "sd_bus_set_connected_signal"
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_connected_signal, sd_bus_get_connected_signal \- Control emission of local connection establishment signal on bus connections
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_connected_signal('u
32 .BI "int sd_bus_set_connected_signal(sd_bus\ *" "bus" ", int\ " "b" ");"
33 .HP \w'int\ sd_bus_get_connected_signal('u
34 .BI "int sd_bus_get_connected_signal(sd_bus\ *" "bus" ");"
35 .SH "DESCRIPTION"
36 .PP
37 \fBsd_bus_set_connected_signal()\fR
38 may be used to control whether a local, synthetic
39 \fBConnected()\fR
40 signal message shall be generated and enqueued for dispatching when the connection is fully established\&. If the
41 \fIb\fR
42 parameter is zero the message is not generated (the default), otherwise it is generated\&.
43 .PP
44 \fBsd_bus_get_connected_signal()\fR
45 may be used to query whether this feature is enabled\&. It returns zero if not, positive otherwise\&.
46 .PP
47 The
48 \fBConnected()\fR
49 signal message is generated from the
50 "org\&.freedesktop\&.DBus\&.Local"
51 service and interface, and
52 "/org/freedesktop/DBus/Local"
53 object path\&. Use
54 \fBsd_bus_match_signal_async\fR(3)
55 to match on this signal\&.
56 .PP
57 This message is particularly useful on slow transports where connections take a long time to be established\&. This is especially the case when
58 \fBsd_bus_set_watch_bind\fR(3)
59 is used\&. The signal is generated when the
60 \fBsd_bus_is_ready\fR(3)
61 returns positive for the first time\&.
62 .PP
63 The
64 \fBConnected()\fR
65 signal corresponds with the
66 \fBDisconnected()\fR
67 signal that is synthesized locally when the connection is terminated\&. The latter is generated unconditionally however, unlike the former which needs to be enabled explicitly before it is generated, with
68 \fBsd_bus_set_connected_signal()\fR\&.
69 .SH "RETURN VALUE"
70 .PP
71 On success, these functions return 0 or a positive integer\&. On failure, they return a negative errno\-style error code\&.
72 .SS "Errors"
73 .PP
74 Returned errors may indicate the following problems:
75 .PP
76 \fB\-ECHILD\fR
77 .RS 4
78 The bus connection has been created in a different process, library or module instance\&.
79 .RE
80 .SH "NOTES"
81 .PP
82 Functions described here are available as a shared library, which can be compiled against and linked to with the
83 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
84 file\&.
85 .PP
86 The code described here uses
87 \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
88 \fBsetenv\fR(3)
89 from a parallel thread\&. It is recommended to only do calls to
90 \fBsetenv()\fR
91 from an early phase of the program when no other threads have been started\&.
92 .SH "HISTORY"
93 .PP
94 \fBsd_bus_set_connected_signal()\fR
95 and
96 \fBsd_bus_get_connected_signal()\fR
97 were added in version 237\&.
98 .SH "SEE ALSO"
99 .PP
100 \fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_match_signal_async\fR(3), \fBsd_bus_set_watch_bind\fR(3), \fBsd_bus_is_ready\fR(3)