| 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_bus_can_send" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
|
| 9 |
<refentryinfo> |
| 10 |
<title>sd_bus_can_send</title> |
| 11 |
<productname>systemd</productname> |
| 12 |
</refentryinfo> |
| 13 |
|
| 14 |
<refmeta> |
| 15 |
<refentrytitle>sd_bus_can_send</refentrytitle> |
| 16 |
<manvolnum>3</manvolnum> |
| 17 |
</refmeta> |
| 18 |
|
| 19 |
<refnamediv> |
| 20 |
<refname>sd_bus_can_send</refname> |
| 21 |
|
| 22 |
<refpurpose>Check which types can be sent over a bus object</refpurpose> |
| 23 |
</refnamediv> |
| 24 |
|
| 25 |
<refsynopsisdiv> |
| 26 |
<funcsynopsis> |
| 27 |
<funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> |
| 28 |
|
| 29 |
<funcprototype> |
| 30 |
<funcdef>int <function>sd_bus_can_send</function></funcdef> |
| 31 |
<paramdef>sd_bus *<parameter>bus</parameter></paramdef> |
| 32 |
<paramdef>char <parameter>type</parameter></paramdef> |
| 33 |
</funcprototype> |
| 34 |
</funcsynopsis> |
| 35 |
</refsynopsisdiv> |
| 36 |
|
| 37 |
<refsect1> |
| 38 |
<title>Description</title> |
| 39 |
|
| 40 |
<para><function>sd_bus_can_send()</function> is mostly used for checking if file descriptor |
| 41 |
passing is available on the given bus. <parameter>type</parameter> can be any of the |
| 42 |
<constant>SD_BUS_TYPE</constant> constants.</para> |
| 43 |
</refsect1> |
| 44 |
|
| 45 |
<refsect1> |
| 46 |
<title>Return Value</title> |
| 47 |
|
| 48 |
<para>On failure, <function>sd_bus_can_send()</function> returns a negative errno-style error |
| 49 |
code. If values of the given type can be sent over the given bus, it returns a positive integer. |
| 50 |
Otherwise, it returns zero.</para> |
| 51 |
|
| 52 |
<refsect2> |
| 53 |
<title>Errors</title> |
| 54 |
|
| 55 |
<para>Returned errors may indicate the following problems:</para> |
| 56 |
|
| 57 |
<variablelist> |
| 58 |
<varlistentry> |
| 59 |
<term><constant>-ENOPKG</constant></term> |
| 60 |
|
| 61 |
<listitem><para>The bus object <parameter>bus</parameter> could not be resolved.</para></listitem> |
| 62 |
</varlistentry> |
| 63 |
|
| 64 |
<varlistentry> |
| 65 |
<term><constant>-ENOTCONN</constant></term> |
| 66 |
|
| 67 |
<listitem><para>The input parameter <parameter>bus</parameter> is |
| 68 |
<constant>NULL</constant> or the bus is not connected.</para></listitem> |
| 69 |
</varlistentry> |
| 70 |
|
| 71 |
<varlistentry> |
| 72 |
<term><constant>-ECHILD</constant></term> |
| 73 |
|
| 74 |
<listitem><para>The bus object <parameter>bus</parameter> was created in a different |
| 75 |
process.</para></listitem> |
| 76 |
</varlistentry> |
| 77 |
</variablelist> |
| 78 |
</refsect2> |
| 79 |
</refsect1> |
| 80 |
|
| 81 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 82 |
|
| 83 |
<refsect1> |
| 84 |
<title>History</title> |
| 85 |
<para><function>sd_bus_can_send()</function> was added in version 221.</para> |
| 86 |
</refsect1> |
| 87 |
|
| 88 |
<refsect1> |
| 89 |
<title>See Also</title> |
| 90 |
|
| 91 |
<para><simplelist type="inline"> |
| 92 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 93 |
<member><citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 94 |
</simplelist></para> |
| 95 |
</refsect1> |
| 96 |
|
| 97 |
</refentry> |