sd_bus_negotiate_timestamps.html 8.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_bus_negotiate_fds</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
    a.headerlink {
      color: #c60f0f;
      font-size: 0.8em;
      padding: 0 4px 0 4px;
      text-decoration: none;
      visibility: hidden;
    }

    a.headerlink:hover {
      background-color: #c60f0f;
      color: white;
    }

    h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
      visibility: visible;
    }
  </style><a href="index.html">Index </a>·
  <a href="systemd.directives.html">Directives </a>·
  <a href="../python-systemd/index.html">Python </a>·
  <a href="../libudev/index.html">libudev </a>·
Michael Biebl's avatar
Michael Biebl committed
22
  <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="sd_bus_negotiate_fds"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_bus_negotiate_fds, sd_bus_negotiate_timestamps, sd_bus_negotiate_creds — Control feature negotiation on bus connections</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-bus.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_bus_negotiate_fds</b>(</code></td><td>sd_bus *<var class="pdparam">bus</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">b</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_bus_negotiate_timestamp</b>(</code></td><td>sd_bus *<var class="pdparam">bus</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">b</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">sd_bus_negotiate_creds</b>(</code></td><td>sd_bus *<var class="pdparam">bus</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">b</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm214169882656"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_bus_negotiate_fds()</code> controls whether
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    file descriptor passing shall be negotiated for the specified bus
    connection. It takes a bus object and a boolean, which, when true,
    enables file descriptor passing, and, when false, disables it. Note
    that not all transports and servers support file descriptor
    passing. To find out whether file descriptor passing is available
    after negotiation, use
    <a href="sd_bus_can_send.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_can_send</span>(3)</span></a>
    and pass <code class="constant">SD_BUS_TYPE_UNIX_FD</code>. Note that file
    descriptor passing is always enabled for both sending and
    receiving or for neither, but never only in one direction. By
    default, file descriptor passing is negotiated for all
    connections.</p><p>Note that when bus activation is used, it is highly
    recommended to set the <code class="option">AcceptFileDescriptors=</code>
    setting in the <code class="filename">.busname</code> unit file to the same
    setting as negotiated by the program ultimately activated. By
    default, file descriptor passing is enabled for both.</p><p><code class="function">sd_bus_negotiate_timestamps()</code> controls
    whether implicit sender timestamps shall be attached automatically
    to all incoming messages. Takes a bus object and a boolean, which,
    when true, enables timestamping, and, when false, disables it. If
    this is disabled,
    <a href="sd_bus_message_get_monotonic_usec.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_monotonic_usec</span>(3)</span></a>,
    <a href="sd_bus_message_get_realtime_usec.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_realtime_usec</span>(3)</span></a>,
    <a href="sd_bus_message_get_seqno.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_seqno</span>(3)</span></a>
    fail with <code class="constant">-ENODATA</code> on incoming messages. Note
    that not all transports support timestamping of messages. On local
    transports, the timestamping is applied by the kernel and cannot be
    manipulated by userspace.</p><p><code class="function">sd_bus_negotiate_creds()</code> controls
    whether implicit sender credentials shall be attached
    automatically to all incoming messages. Takes a bus object and a
    bit mask value, which controls which credential parameters are
    attached. If this is not used,
    <a href="sd_bus_message_get_creds.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_creds</span>(3)</span></a>
    fails with <code class="constant">-ENODATA</code> on incoming
    messages. Note that not all transports support attaching sender
    credentials to messages, or do not support all types of sender
    credential parameters. On local transports, the sender credentials
    are attached by the kernel and cannot be manipulated by
    userspace. By default, no sender credentials are attached.</p><p>These functions may be called only before the connection has
    been started with
Michael Biebl's avatar
Michael Biebl committed
62
    <a href="sd_bus_start.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_start</span>(3)</span></a>.</p></div><div class="refsect1"><a name="idm214169485440"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p>On success, these functions returns 0 or a
63
    positive integer. On failure, they return a negative errno-style
Michael Biebl's avatar
Michael Biebl committed
64
    error code.</p></div><div class="refsect1"><a name="idm214170824416"></a><h2 id="Errors">Errors<a class="headerlink" title="Permalink to this headline" href="#Errors"></a></h2><p>Returned errors may indicate the following problems:</p><div class="variablelist"><dl class="variablelist"><dt id="-EPERM"><span class="term"><code class="varname">-EPERM</code></span><a class="headerlink" title="Permalink to this term" href="#-EPERM"></a></dt><dd><p>The bus connection has already been started.</p></dd></dl></div></div><div class="refsect1"><a name="idm214170355552"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p><code class="function">sd_bus_negotiate_fs()</code> and the other
65 66 67
    functions described here are available as a shared library, which
    can be compiled and linked to with the
    <code class="constant">libsystemd</code> <a href="pkg-config.html"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
Michael Biebl's avatar
Michael Biebl committed
68
    file.</p></div><div class="refsect1"><a name="idm214171086400"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
69 70 71 72 73 74 75
      <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
      <a href="sd-bus.html"><span class="citerefentry"><span class="refentrytitle">sd-bus</span>(3)</span></a>,
      <a href="sd_bus_start.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_start</span>(3)</span></a>,
      <a href="sd_bus_message_can_send.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_can_send</span>(3)</span></a>,
      <a href="sd_bus_message_get_monotonic_usec.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_monotonic_usec</span>(3)</span></a>,
      <a href="sd_bus_message_get_creds.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_creds</span>(3)</span></a>
    </p></div></div></body></html>