| 1 |
<?xml version='1.0'?> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="sd_varlink_is_connected" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 7 |
|
| 8 |
<refentryinfo> |
| 9 |
<title>sd_varlink_is_connected</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>sd_varlink_is_connected</refentrytitle> |
| 15 |
<manvolnum>3</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>sd_varlink_is_connected</refname> |
| 20 |
<refname>sd_varlink_is_idle</refname> |
| 21 |
|
| 22 |
<refpurpose>Query if a Varlink connection object is currently connected or idle</refpurpose> |
| 23 |
</refnamediv> |
| 24 |
|
| 25 |
<refsynopsisdiv> |
| 26 |
<funcsynopsis> |
| 27 |
<funcsynopsisinfo>#include <systemd/sd-varlink.h></funcsynopsisinfo> |
| 28 |
|
| 29 |
<funcprototype> |
| 30 |
<funcdef>int <function>sd_varlink_is_connected</function></funcdef> |
| 31 |
<paramdef>sd_varlink *<parameter>link</parameter></paramdef> |
| 32 |
</funcprototype> |
| 33 |
|
| 34 |
<funcprototype> |
| 35 |
<funcdef>int <function>sd_varlink_is_idle</function></funcdef> |
| 36 |
<paramdef>sd_varlink *<parameter>link</parameter></paramdef> |
| 37 |
</funcprototype> |
| 38 |
</funcsynopsis> |
| 39 |
</refsynopsisdiv> |
| 40 |
|
| 41 |
<refsect1> |
| 42 |
<title>Description</title> |
| 43 |
|
| 44 |
<para><function>sd_varlink_is_connected()</function> checks whether the specified Varlink connection |
| 45 |
object is currently connected or whether it has been fully disconnected already.</para> |
| 46 |
|
| 47 |
<para><function>sd_varlink_is_idle()</function> checks whether the specified Varlink connection object is |
| 48 |
currently connected but idle, i.e. may accept a method call for enqueuing (if client side of a Varlink |
| 49 |
connection) or is waiting for more incoming method calls to arrive (if server side of a Varlink |
| 50 |
connection).</para> |
| 51 |
</refsect1> |
| 52 |
|
| 53 |
<refsect1> |
| 54 |
<title>Return Value</title> |
| 55 |
|
| 56 |
<para>If the connection is currently connected <function>sd_varlink_is_connected()</function> returns a |
| 57 |
positive non-zero value. If disconnected it returns 0. If the connection currently is idle |
| 58 |
<function>sd_varlink_is_idle()</function> returns a positive non-zero integer. If not, returns 0. On |
| 59 |
failure, both functions return a negative <varname>errno</varname> error code.</para> |
| 60 |
|
| 61 |
<refsect2> |
| 62 |
<title>Errors</title> |
| 63 |
|
| 64 |
<para>Returned errors may indicate the following problems:</para> |
| 65 |
|
| 66 |
<variablelist> |
| 67 |
<varlistentry> |
| 68 |
<term><constant>-EINVAL</constant></term> |
| 69 |
|
| 70 |
<listitem><para>The specified Varlink connection is invalid.</para></listitem> |
| 71 |
</varlistentry> |
| 72 |
</variablelist> |
| 73 |
</refsect2> |
| 74 |
</refsect1> |
| 75 |
|
| 76 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 77 |
|
| 78 |
<refsect1> |
| 79 |
<title>History</title> |
| 80 |
<para><function>sd_varlink_is_connected()</function> was added in version 259.</para> |
| 81 |
<para><function>sd_varlink_is_idle()</function> was added in version 257.</para> |
| 82 |
</refsect1> |
| 83 |
|
| 84 |
<refsect1> |
| 85 |
<title>See Also</title> |
| 86 |
|
| 87 |
<para><simplelist type="inline"> |
| 88 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 89 |
<member><citerefentry><refentrytitle>sd-varlink</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 90 |
</simplelist></para> |
| 91 |
</refsect1> |
| 92 |
|
| 93 |
</refentry> |