'\" t .TH "SD_BUS_SET_CONNECTED_SIGNAL" "3" "" "systemd 255" "sd_bus_set_connected_signal" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" sd_bus_set_connected_signal, sd_bus_get_connected_signal \- Control emission of local connection establishment signal on bus connections .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ sd_bus_set_connected_signal('u .BI "int sd_bus_set_connected_signal(sd_bus\ *" "bus" ", int\ " "b" ");" .HP \w'int\ sd_bus_get_connected_signal('u .BI "int sd_bus_get_connected_signal(sd_bus\ *" "bus" ");" .SH "DESCRIPTION" .PP \fBsd_bus_set_connected_signal()\fR may be used to control whether a local, synthetic \fBConnected()\fR signal message shall be generated and enqueued for dispatching when the connection is fully established\&. If the \fIb\fR parameter is zero the message is not generated (the default), otherwise it is generated\&. .PP \fBsd_bus_get_connected_signal()\fR may be used to query whether this feature is enabled\&. It returns zero if not, positive otherwise\&. .PP The \fBConnected()\fR signal message is generated from the "org\&.freedesktop\&.DBus\&.Local" service and interface, and "/org/freedesktop/DBus/Local" object path\&. Use \fBsd_bus_match_signal_async\fR(3) to match on this signal\&. .PP This message is particularly useful on slow transports where connections take a long time to be established\&. This is especially the case when \fBsd_bus_set_watch_bind\fR(3) is used\&. The signal is generated when the \fBsd_bus_is_ready\fR(3) returns positive for the first time\&. .PP The \fBConnected()\fR signal corresponds with the \fBDisconnected()\fR 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 \fBsd_bus_set_connected_signal()\fR\&. .SH "RETURN VALUE" .PP On success, these functions return 0 or a positive integer\&. On failure, they return a negative errno\-style error code\&. .SS "Errors" .PP Returned errors may indicate the following problems: .PP \fB\-ECHILD\fR .RS 4 The bus connection has been created in a different process, library or module instance\&. .RE .SH "NOTES" .PP Functions described here are available as a shared library, which can be compiled against and linked to with the \fBlibsystemd\fR\ \&\fBpkg-config\fR(1) file\&. .PP The code described here uses \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 \fBsetenv\fR(3) from a parallel thread\&. It is recommended to only do calls to \fBsetenv()\fR from an early phase of the program when no other threads have been started\&. .SH "HISTORY" .PP \fBsd_bus_set_connected_signal()\fR and \fBsd_bus_get_connected_signal()\fR were added in version 237\&. .SH "SEE ALSO" .PP \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)