]> git.proxmox.com Git - systemd.git/blob - man/sd_bus_message_get_cookie.html
Imported Upstream version 214
[systemd.git] / man / sd_bus_message_get_cookie.html
1 <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>
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 214</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 &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_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="idm214179228944"></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
23 the transaction cookie of a message. The cookie
24 uniquely identifies a message within each bus peer,
25 but is not globally unique. It is assigned when a
26 message is sent.</p><p><code class="function">sd_bus_message_get_reply_cookie()</code>
27 returns the transaction cookie of the message the
28 specified message is a response to. When a reply
29 message is generated for a method call message, its
30 cookie is copied over into this field. Note that while
31 every message that is transferred is identified by a
32 cookie, only response messages carry a reply cookie
33 field.</p><p>Both functions take a message object as first
34 parameter and a place to store the 64-bit cookie
35 in.</p></div><div class="refsect1"><a name="idm214179171968"></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
36 integer. On failure, these calls return a negative
37 errno-style error code.</p><p>On success, the cookie/reply cookie is returned
38 in the specified 64-bit unsigned integer variable.</p></div><div class="refsect1"><a name="idm214179777200"></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="varname">-EINVAL</code></span><a class="headerlink" title="Permalink to this term" href="#-EINVAL"></a></dt><dd><p>A specified parameter
39 is invalid.</p></dd><dt id="-ENODATA"><span class="term"><code class="varname">-ENODATA</code></span><a class="headerlink" title="Permalink to this term" href="#-ENODATA"></a></dt><dd><p>No cookie has been
40 assigned to this message. This either
41 indicates that the message has not
42 been sent yet and hence has no cookie
43 assigned, or that the message is not a
44 method response message and hence
45 carries a reply cookie
46 field.</p></dd></dl></div></div><div class="refsect1"><a name="idm214180026160"></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>
47 and <code class="function">sd_bus_message_get_reply_cookie()</code>
48 interfaces are available as a shared library, which can
49 be compiled and linked to with the
50 <code class="constant">libsystemd</code> <a href="pkg-config.html"><span class="citerefentry"><span class="refentrytitle">pkg-config</span>(1)</span></a>
51 file.</p></div><div class="refsect1"><a name="idm214180103824"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
52 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
53 <a href="sd-bus.html"><span class="citerefentry"><span class="refentrytitle">sd-bus</span>(3)</span></a>,
54 <a href="sd_bus_new.html"><span class="citerefentry"><span class="refentrytitle">sd_bus_new</span>(3)</span></a>
55 </p></div></div></body></html>