mirror of
https://git.proxmox.com/git/systemd
synced 2025-06-05 04:30:27 +00:00
50 lines
5.5 KiB
HTML
50 lines
5.5 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_bus_message_get_cookie</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>·
|
||
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="sd_bus_message_get_cookie"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_bus_message_get_cookie, sd_bus_message_get_reply_cookie — Returns the transaction cookie 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_cookie</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">cookie</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_reply_cookie</b>(</code></td><td>sd_bus_message *<var class="pdparam">message</var>, </td></tr><tr><td> </td><td>uint64_t *<var class="pdparam">cookie</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm140618369096544"></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_cookie()</code> returns the
|
||
transaction cookie of a message. The cookie uniquely identifies a
|
||
message within each bus peer, but is not globally unique. It is
|
||
assigned when a message is sent.</p><p><code class="function">sd_bus_message_get_reply_cookie()</code>
|
||
returns the transaction cookie of the message the specified
|
||
message is a response to. When a reply message is generated for a
|
||
method call message, its cookie is copied over into this field.
|
||
Note that while every message that is transferred is identified by
|
||
a cookie, only response messages carry a reply cookie
|
||
field.</p><p>Both functions take a message object as first parameter and
|
||
a place to store the 64-bit cookie in.</p></div><div class="refsect1"><a name="idm140618369092768"></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 cookie/reply cookie is returned in the
|
||
specified 64-bit unsigned integer variable.</p></div><div class="refsect1"><a name="idm140618369090944"></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 cookie has been assigned to this message.
|
||
This either indicates that the message has not been sent yet
|
||
and hence has no cookie assigned, or that the message is not a
|
||
method response message and hence carries a reply cookie
|
||
field.</p></dd></dl></div></div><div class="refsect1"><a name="idm140618372988656"></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_cookie()</code> and
|
||
<code class="function">sd_bus_message_get_reply_cookie()</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="idm140618372984384"></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>
|
||
</p></div></div></body></html>
|