]> git.proxmox.com Git - systemd.git/blob - man/sd_bus_negotiate_timestamps.html
Imported Upstream version 220
[systemd.git] / man / sd_bus_negotiate_timestamps.html
1 <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>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 220</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>, </td></tr><tr><td> </td><td>uint64_t <var class="pdparam">flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm140394839671872"></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 file descriptor passing shall be negotiated for the specified bus
24 connection. It takes a bus object and a boolean, which, when true,
25 enables file descriptor passing, and, when false, disables it. Note
26 that not all transports and servers support file descriptor
27 passing. To find out whether file descriptor passing is available
28 after negotiation, use
29 <a href="sd_bus_can_send.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_can_send</span>(3)</span></a>
30 and pass <code class="constant">SD_BUS_TYPE_UNIX_FD</code>. Note that file
31 descriptor passing is always enabled for both sending and
32 receiving or for neither, but never only in one direction. By
33 default, file descriptor passing is negotiated for all
34 connections.</p><p>Note that when bus activation is used, it is highly
35 recommended to set the <code class="option">AcceptFileDescriptors=</code>
36 setting in the <code class="filename">.busname</code> unit file to the same
37 setting as negotiated by the program ultimately activated. By
38 default, file descriptor passing is enabled for both.</p><p><code class="function">sd_bus_negotiate_timestamps()</code> controls
39 whether implicit sender timestamps shall be attached automatically
40 to all incoming messages. Takes a bus object and a boolean, which,
41 when true, enables timestamping, and, when false, disables it. If
42 this is disabled,
43 <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>,
44 <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>,
45 <a href="sd_bus_message_get_seqnum.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_seqnum</span>(3)</span></a>
46 fail with <code class="constant">-ENODATA</code> on incoming messages. Note
47 that not all transports support timestamping of messages. On local
48 transports, the timestamping is applied by the kernel and cannot
49 be manipulated by userspace. By default, message timestamping is
50 not negotiated for all connections.</p><p><code class="function">sd_bus_negotiate_creds()</code> controls
51 whether implicit sender credentials shall be attached
52 automatically to all incoming messages. Takes a bus object, a
53 boolean indicating whether to enable or disable the credential
54 parts encoded in the bit mask value argument. Note that not all
55 transports support attaching sender credentials to messages, or do
56 not support all types of sender credential parameters, or might
57 suppress them under certain circumstances for individual
58 messages. On local transports, the sender credentials are attached
59 by the kernel and cannot be manipulated by userspace. By default,
60 no sender credentials are attached.</p><p>The <code class="function">sd_bus_negotiate_fds()</code> function may
61 be called only before the connection has been started with
62 <a href="sd_bus_start.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_start</span>(3)</span></a>. Both
63 <code class="function">sd_bus_negotiate_timestamp()</code> and
64 <code class="function">sd_bus_negotiate_creds()</code> also may be called
65 after a connection has been set up. Note that when operating on a
66 connection that is shared between multiple components of the same
67 program (for example via
68 <a href="sd_bus_default.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_default</span>(3)</span></a>)
69 it is highly recommended to only enable additional per message
70 metadata fields, but never disable them again, in order not to
71 disable functionality needed by other components.</p></div><div class="refsect1"><a name="idm140394839656976"></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
72 positive integer. On failure, they return a negative errno-style
73 error code.</p></div><div class="refsect1"><a name="idm140394839655680"></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="constant">-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="idm140394839652736"></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
74 functions described here are available as a shared library, which
75 can be compiled and linked to with the
76 <code class="constant">libsystemd</code> <a href="http://linux.die.net/man/1/pkg-config"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
77 file.</p></div><div class="refsect1"><a name="idm140394839649552"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
78 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
79 <a href="sd-bus.html"><span class="citerefentry"><span class="refentrytitle">sd-bus</span>(3)</span></a>,
80 <a href="sd_bus_start.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_start</span>(3)</span></a>,
81 <a href="sd_bus_message_can_send.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_can_send</span>(3)</span></a>,
82 <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>,
83 <a href="sd_bus_message_get_creds.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_message_get_creds</span>(3)</span></a>,
84 <a href="systemd.busname.html"><span class="citerefentry"><span class="refentrytitle">systemd.busname</span>(5)</span></a>
85 </p></div></div></body></html>