chiark / gitweb /
man: rework nspawn man page to suggest yum --installroot instead of mock
[elogind.git] / man / sd_get_seats.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   This file is part of systemd.
7
8   Copyright 2010 Lennart Poettering
9
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation; either version 2.1 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19
20   You should have received a copy of the GNU Lesser General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="sd_get_seats">
25
26         <refentryinfo>
27                 <title>sd_get_seats</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>sd_get_seats</refentrytitle>
42                 <manvolnum>3</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>sd_get_seats</refname>
47                 <refname>sd_get_sessions</refname>
48                 <refname>sd_get_uids</refname>
49                 <refpurpose>Determine available seats, sessions and logged in users</refpurpose>
50         </refnamediv>
51
52         <refsynopsisdiv>
53                 <funcsynopsis>
54                         <funcsynopsisinfo>#include &lt;systemd/sd-login.h&gt;</funcsynopsisinfo>
55
56                         <funcprototype>
57                                 <funcdef>int <function>sd_get_seats</function></funcdef>
58                                 <paramdef>char*** <parameter>seats</parameter></paramdef>
59                         </funcprototype>
60
61                         <funcprototype>
62                                 <funcdef>int <function>sd_get_sessions</function></funcdef>
63                                 <paramdef>char*** <parameter>sessions</parameter></paramdef>
64                         </funcprototype>
65
66                         <funcprototype>
67                                 <funcdef>int <function>sd_get_uids</function></funcdef>
68                                 <paramdef>char*** <parameter>sessions</parameter></paramdef>
69                         </funcprototype>
70
71                 </funcsynopsis>
72         </refsynopsisdiv>
73
74         <refsect1>
75                 <title>Description</title>
76
77                 <para><function>sd_get_seats()</function> may be used
78                 to determine all currently available local
79                 seats. Returns a NULL terminated array of seat
80                 identifiers. The returned array and all strings it
81                 references need to be freed with the libc
82                 <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
83                 call after use. Note that instead of an empty array
84                 NULL may be returned and should be considered
85                 equivalent to an empty array.</para>
86
87                 <para>Similar, <function>sd_get_sessions()</function> may
88                 be used to determine all current login sessions.</para>
89
90                 <para>Similar, <function>sd_get_uids()</function> may
91                 be used to determine all Unix users who currently have login sessions.</para>
92         </refsect1>
93
94         <refsect1>
95                 <title>Return Value</title>
96
97                 <para>On success <function>sd_get_seats()</function>,
98                 <function>sd_get_sessions()</function> and
99                 <function>sd_get_uids()</function> return the number
100                 of entries in the arrays. On failure, these calls
101                 return a negative errno-style error code.</para>
102         </refsect1>
103
104         <refsect1>
105                 <title>Notes</title>
106
107                 <para>The <function>sd_get_seats()</function>,
108                 <function>sd_get_sessions()</function> and
109                 <function>sd_get_uids()</function> interfaces
110                 are available as shared library, which can be compiled
111                 and linked to with the
112                 <literal>libsystemd-login</literal>
113                 <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
114                 file.</para>
115         </refsect1>
116
117         <refsect1>
118                 <title>See Also</title>
119
120                 <para>
121                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
122                         <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
123                         <citerefentry><refentrytitle>sd_session_get_seat</refentrytitle><manvolnum>3</manvolnum></citerefentry>
124                 </para>
125         </refsect1>
126
127 </refentry>