]> git.proxmox.com Git - systemd.git/blob - man/sd_event_get_name.html
Imported Upstream version 219
[systemd.git] / man / sd_event_get_name.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_event_set_name</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 219</span><hr><div class="refentry"><a name="sd_event_set_name"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_event_set_name, sd_event_get_name — Set human-readable names for event sources</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_event_set_name</b>(</code></td><td>sd_event_source *<var class="pdparam">source</var>, </td></tr><tr><td> </td><td>const char *<var class="pdparam">name</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_event_get_name</b>(</code></td><td>sd_event_source *<var class="pdparam">source</var>, </td></tr><tr><td> </td><td>const char **<var class="pdparam">name</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm139842741326656"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_event_set_name()</code> can be used to set
23 an arbitrary name for the event source
24 <em class="parameter"><code>source</code></em>. This name will be used in error
25 messages generated by
26 <a href="sd-event.html"><span class="citerefentry"><span class="refentrytitle">sd-event</span>(3)</span></a>
27 for this source. Specified <em class="parameter"><code>name</code></em> must point
28 to a <code class="constant">NUL</code>-terminated string or be
29 <code class="constant">NULL</code>. In the latter case, the name will be
30 unset. The string is copied internally, so the
31 <em class="parameter"><code>name</code></em> argument is not referenced after the
32 function returns.</p><p><code class="function">sd_event_set_name()</code> can be used to
33 query the current name assigned to source
34 <em class="parameter"><code>source</code></em>. It returns a pointer to the current
35 name (possibly <code class="constant">NULL</code>) in
36 <em class="parameter"><code>name</code></em>.</p></div><div class="refsect1"><a name="idm139842741318240"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p>On success, <code class="function">sd_event_set_name()</code> and
37 <code class="function">sd_event_get_name()</code> return a
38 non-negative integer. On failure, they return a negative
39 errno-style error code.</p></div><div class="refsect1"><a name="idm139842741315504"></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><em class="parameter"><code>source</code></em> is not a valid
40 pointer to an <span class="structname">sd_event_source</span>
41 structure or the <em class="parameter"><code>name</code></em> argument for
42 <code class="function">sd_event_get_name()</code> is
43 <code class="constant">NULL</code>.</p></dd><dt id="-ENOMEM"><span class="term"><code class="constant">-ENOMEM</code></span><a class="headerlink" title="Permalink to this term" href="#-ENOMEM"></a></dt><dd><p>Not enough memory to copy the
44 name.</p></dd></dl></div></div><div class="refsect1"><a name="idm139842745261568"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p>Functions described here are available as a
45 shared library, which can be compiled and linked to with the
46 <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>
47 file.</p></div><div class="refsect1"><a name="idm139842745258656"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
48 <a href="sd-event.html"><span class="citerefentry"><span class="refentrytitle">sd-event</span>(3)</span></a>,
49 <a href="sd_event_add_time.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_time</span>(3)</span></a>,
50 <a href="sd_event_add_child.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_child</span>(3)</span></a>,
51 <a href="sd_event_add_signal.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_signal</span>(3)</span></a>,
52 <a href="sd_event_add_defer.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_defer</span>(3)</span></a>,
53 <a href="sd_event_run.html"><span class="citerefentry"><span class="refentrytitle">sd_event_run</span>(3)</span></a>
54 </p></div></div></body></html>