chiark / gitweb /
man: document calendar timers
[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
93                 <para>Note that the returned lists are not sorted and in an undefined order.</para>
94         </refsect1>
95
96         <refsect1>
97                 <title>Return Value</title>
98
99                 <para>On success <function>sd_get_seats()</function>,
100                 <function>sd_get_sessions()</function> and
101                 <function>sd_get_uids()</function> return the number
102                 of entries in the arrays. On failure, these calls
103                 return a negative errno-style error code.</para>
104         </refsect1>
105
106         <refsect1>
107                 <title>Notes</title>
108
109                 <para>The <function>sd_get_seats()</function>,
110                 <function>sd_get_sessions()</function> and
111                 <function>sd_get_uids()</function> interfaces
112                 are available as shared library, which can be compiled
113                 and linked to with the
114                 <literal>libsystemd-login</literal>
115                 <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
116                 file.</para>
117         </refsect1>
118
119         <refsect1>
120                 <title>See Also</title>
121
122                 <para>
123                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
124                         <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
125                         <citerefentry><refentrytitle>sd_session_get_seat</refentrytitle><manvolnum>3</manvolnum></citerefentry>
126                 </para>
127         </refsect1>
128
129 </refentry>