chiark / gitweb /
tree-wide: remove Lennart's copyright lines
[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   SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="sd_get_seats" conditional='HAVE_PAM'
10           xmlns:xi="http://www.w3.org/2001/XInclude">
11
12   <refentryinfo>
13     <title>sd_get_seats</title>
14     <productname>elogind</productname>
15
16     <authorgroup>
17       <author>
18         <contrib>Developer</contrib>
19         <firstname>Lennart</firstname>
20         <surname>Poettering</surname>
21         <email>lennart@poettering.net</email>
22       </author>
23     </authorgroup>
24   </refentryinfo>
25
26   <refmeta>
27     <refentrytitle>sd_get_seats</refentrytitle>
28     <manvolnum>3</manvolnum>
29   </refmeta>
30
31   <refnamediv>
32     <refname>sd_get_seats</refname>
33     <refname>sd_get_sessions</refname>
34     <refname>sd_get_uids</refname>
35     <refname>sd_get_machine_names</refname>
36     <refpurpose>Determine available seats, sessions, logged in users and virtual machines/containers</refpurpose>
37   </refnamediv>
38
39   <refsynopsisdiv>
40     <funcsynopsis>
41       <funcsynopsisinfo>#include &lt;elogind/sd-login.h&gt;</funcsynopsisinfo>
42
43       <funcprototype>
44         <funcdef>int <function>sd_get_seats</function></funcdef>
45         <paramdef>char ***<parameter>seats</parameter></paramdef>
46       </funcprototype>
47
48       <funcprototype>
49         <funcdef>int <function>sd_get_sessions</function></funcdef>
50         <paramdef>char ***<parameter>sessions</parameter></paramdef>
51       </funcprototype>
52
53       <funcprototype>
54         <funcdef>int <function>sd_get_uids</function></funcdef>
55         <paramdef>uid_t **<parameter>users</parameter></paramdef>
56       </funcprototype>
57
58       <funcprototype>
59         <funcdef>int <function>sd_get_machine_names</function></funcdef>
60         <paramdef>char ***<parameter>machines</parameter></paramdef>
61       </funcprototype>
62
63     </funcsynopsis>
64   </refsynopsisdiv>
65
66   <refsect1>
67     <title>Description</title>
68
69     <para><function>sd_get_seats()</function> may be used to determine
70     all currently available local seats. Returns the number of seat
71     identifiers and if the input pointer is non-NULL, a
72     <constant>NULL</constant>-terminated array of seat identifiers
73     is stored at the address.
74     The returned array and all strings it references need to be freed
75     with the libc
76     <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
77     call after use. Note that instead of an empty array
78     <constant>NULL</constant> may be returned and should be considered
79     equivalent to an empty array.</para>
80
81     <para>Similarly, <function>sd_get_sessions()</function> may be
82     used to determine all current login sessions.</para>
83
84     <para>Similarly, <function>sd_get_uids()</function> may be used to
85     determine all Unix users who currently have login sessions.</para>
86
87     <para>Similarly, <function>sd_get_machine_names()</function> may
88     be used to determine all current virtual machines and containers
89     on the system.</para>
90
91     <para>Note that the returned lists are not sorted and in an
92     undefined order.</para>
93   </refsect1>
94
95   <refsect1>
96     <title>Return Value</title>
97
98     <para>On success, <function>sd_get_seats()</function>,
99     <function>sd_get_sessions()</function>,
100     <function>sd_get_uids()</function> and
101     <function>sd_get_machine_names()</function> return the number of
102     entries in the arrays. On failure, these calls return a negative
103     errno-style error code.</para>
104   </refsect1>
105
106   <refsect1>
107     <title>Errors</title>
108
109     <para>Returned errors may indicate the following problems:</para>
110
111     <variablelist>
112
113       <varlistentry>
114         <term><constant>-ENOMEM</constant></term>
115
116         <listitem><para>Memory allocation failed.</para></listitem>
117       </varlistentry>
118     </variablelist>
119   </refsect1>
120
121   <xi:include href="libelogind-pkgconfig.xml" />
122
123   <refsect1>
124     <title>See Also</title>
125
126     <para>
127       <!-- 0 /// elogind is in section 8
128       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
129       --><!-- else -->
130       <citerefentry><refentrytitle>elogind</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
131       <!-- // 0 -->
132       <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
133       <citerefentry><refentrytitle>sd_session_get_seat</refentrytitle><manvolnum>3</manvolnum></citerefentry>
134     </para>
135   </refsect1>
136
137 </refentry>