]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_get_seats.xml
TODO: Remove Elapsed Time DHCPv6 option as it is done
[thirdparty/systemd.git] / man / sd_get_seats.xml
CommitLineData
0b3b020a
LP
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
5430f7f2
LP
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
0b3b020a
LP
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
5430f7f2 18 Lesser General Public License for more details.
0b3b020a 19
5430f7f2 20 You should have received a copy of the GNU Lesser General Public License
0b3b020a
LP
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22-->
23
56ba3c78 24<refentry id="sd_get_seats" conditional='HAVE_PAM'>
0b3b020a
LP
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>
a20affe2
LP
49 <refname>sd_get_machine_names</refname>
50 <refpurpose>Determine available seats, sessions, logged in users and virtual machines/containers</refpurpose>
0b3b020a
LP
51 </refnamediv>
52
53 <refsynopsisdiv>
54 <funcsynopsis>
55 <funcsynopsisinfo>#include &lt;systemd/sd-login.h&gt;</funcsynopsisinfo>
56
57 <funcprototype>
58 <funcdef>int <function>sd_get_seats</function></funcdef>
3b3d7d06 59 <paramdef>char ***<parameter>seats</parameter></paramdef>
0b3b020a
LP
60 </funcprototype>
61
62 <funcprototype>
63 <funcdef>int <function>sd_get_sessions</function></funcdef>
3b3d7d06 64 <paramdef>char ***<parameter>sessions</parameter></paramdef>
0b3b020a
LP
65 </funcprototype>
66
67 <funcprototype>
68 <funcdef>int <function>sd_get_uids</function></funcdef>
3b3d7d06 69 <paramdef>uid_t **<parameter>users</parameter></paramdef>
0b3b020a
LP
70 </funcprototype>
71
a20affe2
LP
72 <funcprototype>
73 <funcdef>int <function>sd_get_machine_names</function></funcdef>
3b3d7d06 74 <paramdef>char ***<parameter>machines</parameter></paramdef>
a20affe2
LP
75 </funcprototype>
76
0b3b020a
LP
77 </funcsynopsis>
78 </refsynopsisdiv>
79
80 <refsect1>
81 <title>Description</title>
82
83 <para><function>sd_get_seats()</function> may be used
84 to determine all currently available local
74d00578 85 seats. Returns a <constant>NULL</constant> terminated array of seat
595aae37
LP
86 identifiers. The returned array and all strings it
87 references need to be freed with the libc
5aded369 88 <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
595aae37 89 call after use. Note that instead of an empty array
74d00578 90 <constant>NULL</constant> may be returned and should be considered
595aae37 91 equivalent to an empty array.</para>
0b3b020a 92
494a6682 93 <para>Similarly, <function>sd_get_sessions()</function> may
0b3b020a
LP
94 be used to determine all current login sessions.</para>
95
494a6682 96 <para>Similarly, <function>sd_get_uids()</function> may
0b3b020a 97 be used to determine all Unix users who currently have login sessions.</para>
4e818ef3 98
494a6682 99 <para>Similarly,
a20affe2
LP
100 <function>sd_get_machine_names()</function> may be
101 used to determine all current virtual machines and
102 containers on the system.</para>
103
4e818ef3 104 <para>Note that the returned lists are not sorted and in an undefined order.</para>
0b3b020a
LP
105 </refsect1>
106
107 <refsect1>
108 <title>Return Value</title>
109
b040723e 110 <para>On success, <function>sd_get_seats()</function>,
a20affe2
LP
111 <function>sd_get_sessions()</function>,
112 <function>sd_get_uids()</function> and
113 <function>sd_get_machine_names()</function> return the
114 number of entries in the arrays. On failure, these
115 calls return a negative errno-style error code.</para>
0b3b020a
LP
116 </refsect1>
117
118 <refsect1>
119 <title>Notes</title>
120
121 <para>The <function>sd_get_seats()</function>,
a20affe2
LP
122 <function>sd_get_sessions()</function>,
123 <function>sd_get_uids()</function> and
124 <function>sd_get_machine_names()</function> interfaces
494a6682 125 are available as a shared library, which can be compiled
0b3b020a 126 and linked to with the
5aded369 127 <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
0b3b020a
LP
128 file.</para>
129 </refsect1>
130
131 <refsect1>
132 <title>See Also</title>
133
134 <para>
135 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
cb07866b 136 <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
595aae37 137 <citerefentry><refentrytitle>sd_session_get_seat</refentrytitle><manvolnum>3</manvolnum></citerefentry>
0b3b020a
LP
138 </para>
139 </refsect1>
140
141</refentry>