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">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
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 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="sd_get_seats">
27 <title>sd_get_seats</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>sd_get_seats</refentrytitle>
42 <manvolnum>3</manvolnum>
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>
54 <funcsynopsisinfo>#include <systemd/sd-login.h></funcsynopsisinfo>
57 <funcdef>int <function>sd_get_seats</function></funcdef>
58 <paramdef>char*** <parameter>seats</parameter></paramdef>
62 <funcdef>int <function>sd_get_sessions</function></funcdef>
63 <paramdef>char*** <parameter>sessions</parameter></paramdef>
67 <funcdef>int <function>sd_get_uids</function></funcdef>
68 <paramdef>char*** <parameter>sessions</parameter></paramdef>
75 <title>Description</title>
77 <para><function>sd_get_seats()</function> may be used
78 to determine all currently available local
79 seats. Returns an array of seat identifiers. The
80 returned array and all strings it references need to
81 be freed with the libc
82 <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
83 call after use.</para>
85 <para>Similar, <function>sd_get_sessions()</function> may
86 be used to determine all current login sessions.</para>
88 <para>Similar, <function>sd_get_uids()</function> may
89 be used to determine all Unix users who currently have login sessions.</para>
93 <title>Return Value</title>
95 <para>On success <function>sd_get_seats()</function>,
96 <function>sd_get_sessions()</function> and
97 <function>sd_get_uids()</function> return the number
98 of entries in the arrays. On failure, these calls
99 return a negative errno-style error code.</para>
105 <para>The <function>sd_get_seats()</function>,
106 <function>sd_get_sessions()</function> and
107 <function>sd_get_uids()</function> interfaces
108 are available as shared library, which can be compiled
109 and linked to with the
110 <literal>libsystemd-login</literal>
111 <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
116 <title>See Also</title>
119 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
120 <citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
121 <citerefentry><refentrytitle>sd_session_get_seat</refentrytitle><manvolnum>3</manvolnum></citerefentry>,