]> git.proxmox.com Git - systemd.git/blob - man/sd_seat_get_active.html
Imported Upstream version 218
[systemd.git] / man / sd_seat_get_active.html
1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>sd_seat_get_active</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 218</span><hr><div class="refentry"><a name="sd_seat_get_active"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>sd_seat_get_active, sd_seat_get_sessions, sd_seat_can_multi_session, sd_seat_can_tty, sd_seat_can_graphical — Determine state of a specific seat</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;systemd/sd-login.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_seat_get_active</b>(</code></td><td>const char *<var class="pdparam">seat</var>, </td></tr><tr><td> </td><td>char **<var class="pdparam">session</var>, </td></tr><tr><td> </td><td>uid_t *<var class="pdparam">uid</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_seat_get_sessions</b>(</code></td><td>const char *<var class="pdparam">seat</var>, </td></tr><tr><td> </td><td>char ***<var class="pdparam">sessions</var>, </td></tr><tr><td> </td><td>uid_t **<var class="pdparam">uid</var>, </td></tr><tr><td> </td><td>unsigned int *<var class="pdparam">n_uids</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_seat_can_multi_session</b>(</code></td><td>const char *<var class="pdparam">seat</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_seat_can_tty</b>(</code></td><td>const char *<var class="pdparam">seat</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_seat_can_graphical</b>(</code></td><td>const char *<var class="pdparam">seat</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm139917953911264"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description"></a></h2><p><code class="function">sd_seat_get_active()</code> may be
23 used to determine which session is currently active on
24 a seat, if there is any. Returns the session
25 identifier and the user identifier of the Unix user
26 the session is belonging to. Either the session or the
27 user identifier parameter can be passed
28 <code class="constant">NULL</code>, in case only one of the
29 parameters shall be queried. The returned string needs
30 to be freed with the libc
31 <a href="http://man7.org/linux/man-pages/man3/free.3.html"><span class="citerefentry"><span class="refentrytitle">free</span>(3)</span></a>
32 call after use.</p><p><code class="function">sd_seat_get_sessions()</code> may
33 be used to determine all sessions on the specified
34 seat. Returns two arrays, one (<code class="constant">NULL</code> terminated) with
35 the session identifiers of the sessions and one with
36 the user identifiers of the Unix users the sessions
37 belong to. An additional parameter may be used to
38 return the number of entries in the latter array. The
39 two arrays and the latter parameter may be passed as
40 <code class="constant">NULL</code> in case these values need not to be
41 determined. The arrays and the strings referenced by
42 them need to be freed with the libc
43 <a href="http://man7.org/linux/man-pages/man3/free.3.html"><span class="citerefentry"><span class="refentrytitle">free</span>(3)</span></a>
44 call after use. Note that instead of an empty array
45 <code class="constant">NULL</code> may be returned and should be considered
46 equivalent to an empty array.</p><p><code class="function">sd_seat_can_multi_session()</code>
47 may be used to determine whether a specific seat is
48 capable of multi-session, i.e. allows multiple login
49 sessions in parallel (with only one being active at a
50 time).</p><p><code class="function">sd_seat_can_tty()</code> may be
51 used to determine whether a specific seat provides TTY
52 functionality, i.e. is useful as a text console.</p><p><code class="function">sd_seat_can_graphical()</code> may
53 be used to determine whether a specific seat provides
54 graphics functionality, i.e. is useful as a graphics
55 display.</p><p>If the <code class="varname">seat</code> parameter of any
56 of these functions is passed as
57 <code class="constant">NULL</code>, the operation is executed
58 for the seat of the session of the calling process, if
59 there is any.</p></div><div class="refsect1"><a name="idm139917953898624"></a><h2 id="Return Value">Return Value<a class="headerlink" title="Permalink to this headline" href="#Return%20Value"></a></h2><p> On success,
60 <code class="function">sd_seat_get_active()</code>
61 returns 0 or a positive integer. On success,
62 <code class="function">sd_seat_get_sessions()</code> returns
63 the number of entries in the session identifier
64 array. If the test succeeds,
65 <code class="function">sd_seat_can_multi_session</code>,
66 <code class="function">sd_seat_can_tty</code> and
67 <code class="function">sd_seat_can_graphical</code> return a
68 positive integer, if it fails 0. On failure, these
69 calls return a negative errno-style error code.</p></div><div class="refsect1"><a name="idm139917953886240"></a><h2 id="Notes">Notes<a class="headerlink" title="Permalink to this headline" href="#Notes"></a></h2><p>The <code class="function">sd_seat_get_active()</code>,
70 <code class="function">sd_seat_get_sessions()</code>,
71 <code class="function">sd_seat_can_multi_session()</code>,
72 <code class="function">sd_seat_can_tty()</code> and
73 <code class="function">sd_seat_can_grapical()</code> interfaces
74 are available as a shared library, which can be compiled
75 and linked to with the
76 <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>
77 file.</p></div><div class="refsect1"><a name="idm139917953879680"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
78 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
79 <a href="sd-login.html"><span class="citerefentry"><span class="refentrytitle">sd-login</span>(3)</span></a>,
80 <a href="sd_session_get_seat.html"><span class="citerefentry"><span class="refentrytitle">sd_session_get_seat</span>(3)</span></a>
81 </p></div></div></body></html>