mirror of
https://git.proxmox.com/git/systemd
synced 2025-07-16 10:32:00 +00:00
55 lines
6.1 KiB
HTML
55 lines
6.1 KiB
HTML
<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>
|
||
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_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 <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_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
|
||
an arbitrary name for the event source
|
||
<em class="parameter"><code>source</code></em>. This name will be used in error
|
||
messages generated by
|
||
<a href="sd-event.html"><span class="citerefentry"><span class="refentrytitle">sd-event</span>(3)</span></a>
|
||
for this source. Specified <em class="parameter"><code>name</code></em> must point
|
||
to a <code class="constant">NUL</code>-terminated string or be
|
||
<code class="constant">NULL</code>. In the latter case, the name will be
|
||
unset. The string is copied internally, so the
|
||
<em class="parameter"><code>name</code></em> argument is not referenced after the
|
||
function returns.</p><p><code class="function">sd_event_set_name()</code> can be used to
|
||
query the current name assigned to source
|
||
<em class="parameter"><code>source</code></em>. It returns a pointer to the current
|
||
name (possibly <code class="constant">NULL</code>) in
|
||
<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
|
||
<code class="function">sd_event_get_name()</code> return a
|
||
non-negative integer. On failure, they return a negative
|
||
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
|
||
pointer to an <span class="structname">sd_event_source</span>
|
||
structure or the <em class="parameter"><code>name</code></em> argument for
|
||
<code class="function">sd_event_get_name()</code> is
|
||
<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
|
||
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
|
||
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="idm139842745258656"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
|
||
<a href="sd-event.html"><span class="citerefentry"><span class="refentrytitle">sd-event</span>(3)</span></a>,
|
||
<a href="sd_event_add_time.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_time</span>(3)</span></a>,
|
||
<a href="sd_event_add_child.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_child</span>(3)</span></a>,
|
||
<a href="sd_event_add_signal.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_signal</span>(3)</span></a>,
|
||
<a href="sd_event_add_defer.html"><span class="citerefentry"><span class="refentrytitle">sd_event_add_defer</span>(3)</span></a>,
|
||
<a href="sd_event_run.html"><span class="citerefentry"><span class="refentrytitle">sd_event_run</span>(3)</span></a>
|
||
</p></div></div></body></html>
|