'\" t .TH "SD_VARLINK_IS_CONNECTED" "3" "" "systemd 259" "sd_varlink_is_connected" .\" ----------------------------------------------------------------- .\" * 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_varlink_is_connected, sd_varlink_is_idle \- Query if a Varlink connection object is currently connected or idle .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ sd_varlink_is_connected('u .BI "int sd_varlink_is_connected(sd_varlink\ *" "link" ");" .HP \w'int\ sd_varlink_is_idle('u .BI "int sd_varlink_is_idle(sd_varlink\ *" "link" ");" .SH "DESCRIPTION" .PP \fBsd_varlink_is_connected()\fR checks whether the specified Varlink connection object is currently connected or whether it has been fully disconnected already\&. .PP \fBsd_varlink_is_idle()\fR checks whether the specified Varlink connection object is currently connected but idle, i\&.e\&. may accept a method call for enqueuing (if client side of a Varlink connection) or is waiting for more incoming method calls to arrive (if server side of a Varlink connection)\&. .SH "RETURN VALUE" .PP If the connection is currently connected \fBsd_varlink_is_connected()\fR returns a positive non\-zero value\&. If disconnected it returns 0\&. If the connection currently is idle \fBsd_varlink_is_idle()\fR returns a positive non\-zero integer\&. If not, returns 0\&. On failure, both functions return a negative \fIerrno\fR error code\&. .SS "Errors" .PP Returned errors may indicate the following problems: .PP \fB\-EINVAL\fR .RS 4 The specified Varlink connection is invalid\&. .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_varlink_is_connected()\fR was added in version 259\&. .PP \fBsd_varlink_is_idle()\fR was added in version 257\&. .SH "SEE ALSO" .PP \fBsystemd\fR(1), \fBsd-varlink\fR(3)