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.2/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>void <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> 62 </listitem> 63 </varlistentry> 64 65 <varlistentry> 66 <term><constant>-ENOTCONN</constant></term> 67 68 <listitem><para>The input parameter <parameter>bus</parameter> is 69 <constant>NULL</constant> or the bus is not connected.</para></listitem> 70 </varlistentry> 71 72 <varlistentry> 73 <term><constant>-ECHILD</constant></term> 74 75 <listitem><para>The bus object <parameter>bus</parameter> was created in a different 76 process.</para></listitem> 77 </varlistentry> 78 </variablelist> 79 </refsect2> 80 </refsect1> 81 82 <xi:include href="libsystemd-pkgconfig.xml" /> 83 84 <refsect1> 85 <title>See Also</title> 86 87 <para> 88 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, 89 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry> 90 </para> 91 </refsect1> 92 93</refentry> 94