]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_get_seats.xml
libudev: Move -lrt to Libs.private
[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>
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>
79cd7743 68 <paramdef>uid_t** <parameter>users</parameter></paramdef>
0b3b020a
LP
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
595aae37
LP
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
0b3b020a 82 <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
595aae37
LP
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>
0b3b020a
LP
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>
4e818ef3
LP
92
93 <para>Note that the returned lists are not sorted and in an undefined order.</para>
0b3b020a
LP
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>,
cb07866b 124 <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
595aae37 125 <citerefentry><refentrytitle>sd_session_get_seat</refentrytitle><manvolnum>3</manvolnum></citerefentry>
0b3b020a
LP
126 </para>
127 </refsect1>
128
129</refentry>