<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
- <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="sd_bus_message_get_monotonic_usec"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_bus_message_get_monotonic_usec, sd_bus_message_get_realtime_usec, sd_bus_message_get_seqnum — Retrieve the sender timestamps and sequence number of a message</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <systemd/sd-bus.h></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_message_get_monotonic_usec</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">usec</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_message_get_realtime_usec</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">usec</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_message_get_seqnum</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">seqnum</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm140134631967504"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><code class="function">sd_bus_message_get_monotonic_usec()</code>
+ <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 220</span><hr><div class="refentry"><a name="sd_bus_message_get_monotonic_usec"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_bus_message_get_monotonic_usec, sd_bus_message_get_realtime_usec, sd_bus_message_get_seqnum — Retrieve the sender timestamps and sequence number of a message</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <systemd/sd-bus.h></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_message_get_monotonic_usec</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">usec</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_message_get_realtime_usec</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">usec</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_message_get_seqnum</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">seqnum</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm140718198284608"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><code class="function">sd_bus_message_get_monotonic_usec()</code>
returns the monotonic timestamp of the time the message was sent.
This value is in microseconds since the
<code class="constant">CLOCK_MONOTONIC</code> epoch, see
a global, monotonically increasing sequence number to all messages
transmitted on the local system, at the time the message was sent.
This sequence number is useful for determining message send order,
- even across different busses of the local system. The sequence
+ even across different buses of the local system. The sequence
number combined with the boot ID of the system (as returned by
<a href="sd_id128_get_boot.html"><span class="citerefentry"><span class="refentrytitle">sd_id128_get_boot</span>(3)</span></a>)
is a suitable globally unique identifier for bus messages.</p><p>Note that the sending order and receiving order of messages
transports, and only after support for them has been negotiated
with the
<a href="sd_bus_negotiate_timestamp.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_negotiate_timestamp</span>(3)</span></a>
- call.</p></div><div class="refsect1"><a name="idm140134635860864"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value">¶</a></h2><p>On success, these calls return 0 or a positive integer. On
+ call.</p></div><div class="refsect1"><a name="idm140718198275520"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value">¶</a></h2><p>On success, these calls return 0 or a positive integer. On
failure, these calls return a negative errno-style error
code.</p><p>On success, the timestamp or sequence number is returned in
- the specified 64-bit unsigned integer variable.</p></div><div class="refsect1"><a name="idm140134635859024"></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="-EINVAL"><span class="term"><code class="constant">-EINVAL</code></span><a class="headerlink" title="Permalink to this term" href="#-EINVAL">¶</a></dt><dd><p>A specified parameter is
+ the specified 64-bit unsigned integer variable.</p></div><div class="refsect1"><a name="idm140718198273712"></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="-EINVAL"><span class="term"><code class="constant">-EINVAL</code></span><a class="headerlink" title="Permalink to this term" href="#-EINVAL">¶</a></dt><dd><p>A specified parameter is
invalid.</p></dd><dt id="-ENODATA"><span class="term"><code class="constant">-ENODATA</code></span><a class="headerlink" title="Permalink to this term" href="#-ENODATA">¶</a></dt><dd><p>No timestamp or sequence number information is
attached to the passed message. This error is returned if the
underlying transport does not support timestamping or
assigning of sequence numbers, or if this feature has not been
negotiated with
- <a href="sd_bus_negotiate_timestamp.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_negotiate_timestamp</span>(3)</span></a>.</p></dd></dl></div></div><div class="refsect1"><a name="idm140134635853408"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes">¶</a></h2><p>The
+ <a href="sd_bus_negotiate_timestamp.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_negotiate_timestamp</span>(3)</span></a>.</p></dd></dl></div></div><div class="refsect1"><a name="idm140718198268288"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes">¶</a></h2><p>The
<code class="function">sd_bus_message_get_monotonic_usec()</code>,
<code class="function">sd_bus_message_get_realtime_usec()</code>, and
<code class="function">sd_bus_message_get_seqnum()</code> interfaces are
available as a shared library, which can be compiled and linked to
with the
<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>
- file.</p></div><div class="refsect1"><a name="idm140134635840944"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
+ file.</p></div><div class="refsect1"><a name="idm140718198263744"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
<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_new.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_new</span>(3)</span></a>,