Debian Codegraph @

upstream/debian-unstable/man3/sd_varlink_is_connected.3

raw
1 '\" t
2 .TH "SD_VARLINK_IS_CONNECTED" "3" "" "systemd 261~rc3" "sd_varlink_is_connected"
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_varlink_is_connected, sd_varlink_is_idle \- Query if a Varlink connection object is currently connected or idle
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-varlink\&.h>
29 .fi
30 .ft
31 .HP \w'int\ sd_varlink_is_connected('u
32 .BI "int sd_varlink_is_connected(sd_varlink\ *" "link" ");"
33 .HP \w'int\ sd_varlink_is_idle('u
34 .BI "int sd_varlink_is_idle(sd_varlink\ *" "link" ");"
35 .SH "DESCRIPTION"
36 .PP
37 \fBsd_varlink_is_connected()\fR
38 checks whether the specified Varlink connection object is currently connected or whether it has been fully disconnected already\&.
39 .PP
40 \fBsd_varlink_is_idle()\fR
41 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)\&.
42 .SH "RETURN VALUE"
43 .PP
44 If the connection is currently connected
45 \fBsd_varlink_is_connected()\fR
46 returns a positive non\-zero value\&. If disconnected it returns 0\&. If the connection currently is idle
47 \fBsd_varlink_is_idle()\fR
48 returns a positive non\-zero integer\&. If not, returns 0\&. On failure, both functions return a negative
49 \fIerrno\fR
50 error code\&.
51 .SS "Errors"
52 .PP
53 Returned errors may indicate the following problems:
54 .PP
55 \fB\-EINVAL\fR
56 .RS 4
57 The specified Varlink connection is invalid\&.
58 .RE
59 .SH "NOTES"
60 .PP
61 Functions described here are available as a shared library, which can be compiled against and linked to with the
62 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
63 file\&.
64 .PP
65 The code described here uses
66 \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
67 \fBsetenv\fR(3)
68 from a parallel thread\&. It is recommended to only do calls to
69 \fBsetenv()\fR
70 from an early phase of the program when no other threads have been started\&.
71 .SH "HISTORY"
72 .PP
73 \fBsd_varlink_is_connected()\fR
74 was added in version 259\&.
75 .PP
76 \fBsd_varlink_is_idle()\fR
77 was added in version 257\&.
78 .SH "SEE ALSO"
79 .PP
80 \fBsystemd\fR(1), \fBsd-varlink\fR(3)