sd_session_is_active.xml revision 9541666b8d97f107335dd7e3cb93b4d2cfbf19c9
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering This file is part of systemd.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering Copyright 2010 Lennart Poettering
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering systemd is free software; you can redistribute it and/or modify it
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering under the terms of the GNU Lesser General Public License as published by
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering (at your option) any later version.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering systemd is distributed in the hope that it will be useful, but
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering Lesser General Public License for more details.
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering You should have received a copy of the GNU Lesser General Public License
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
11c3a36649e5e5e77db499c92f3cdcbd619efd3aThomas Hindoe Paaboel Andersen<refentry id="sd_session_is_active" conditional='HAVE_PAM'>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <refentryinfo>
93cc7779e0c121b75183920173f37cd1ee9d59cfThomas Hindoe Paaboel Andersen <productname>systemd</productname>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering </authorgroup>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering </refentryinfo>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <refentrytitle>sd_session_is_active</refentrytitle>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <refname>sd_session_get_service</refname>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <refname>sd_session_get_display</refname>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <refname>sd_session_get_remote_host</refname>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <refname>sd_session_get_remote_user</refname>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <refpurpose>Determine state of a specific session</refpurpose>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <refsynopsisdiv>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcsynopsis>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcsynopsisinfo>#include <systemd/sd-login.h></funcsynopsisinfo>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_is_active</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_is_remote</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_state</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>state</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_uid</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>uid_t* <parameter>uid</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_seat</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>seat</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_service</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>service</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_type</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>type</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_class</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>class</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_display</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>display</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_remote_host</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>remote_host</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_remote_user</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>remote_user</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_tty</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>char** <parameter>tty</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <funcdef>int <function>sd_session_get_vt</function></funcdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>const char* <parameter>session</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <paramdef>unsigned int* <parameter>vt</parameter></paramdef>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcprototype>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </funcsynopsis>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering </refsynopsisdiv>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_is_active()</function> may
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering be used to determine whether the session identified by
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering the specified session identifier is currently active
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering (i.e. currently in the foreground and available for
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering user input) or not.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_is_remote()</function> may
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering be used to determine whether the session identified by
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering the specified session identifier is a remote session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering (i.e. its remote host is known) or not.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_state()</function> may
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering be used to determine the state of the session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identified by the specified session identifier. The
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering following states are currently known:
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <literal>online</literal> (session logged in, but
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering session not active, i.e. not in the foreground),
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <literal>active</literal> (session logged in and
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering active, i.e. in the foreground),
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <literal>closing</literal> (session nominally logged
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering out, but some processes belonging to it are still
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering around). In the future additional states might be
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering defined, client code should be written to be robust in
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering regards to additional state strings being
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering returned. This function is a more generic version of
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <function>sd_session_is_active()</function>. The returned
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering string needs to be freed with the libc
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering call after use.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_uid()</function> may be
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering used to determine the user identifier of the Unix user the session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identified by the specified session identifier belongs
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_seat()</function> may
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering be used to determine the seat identifier of the seat
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering the session identified by the specified session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identifier belongs to. Note that not all sessions are
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering attached to a seat, this call will fail for them. The
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering returned string needs to be freed with the libc
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering call after use.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_service()</function>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering may be used to determine the name of the service (as
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering passed during PAM session setup) that registered the
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering session identified by the specified session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identifier. The returned string needs to be freed with
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering call after use.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_type()</function> may
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering be used to determine the type of the session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identified by the specified session identifier. The
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering returned string is one of <literal>x11</literal>,
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <literal>wayland</literal>, <literal>tty</literal>,
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <literal>mir</literal> or <literal>unspecified</literal> and
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering needs to be freed with the libc
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering call after use.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_class()</function> may
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering be used to determine the class of the session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identified by the specified session identifier. The
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering returned string is one of <literal>user</literal>,
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <literal>background</literal> and needs to be freed
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering call after use.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_display()</function>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering may be used to determine the X11 display of the
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering session identified by the specified session
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering identifier. The returned string needs to be
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering freed with the libc
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering call after use.</para>
d0a7c5f69207b6719bab94893035fc8f5f6f87cbLennart Poettering <para><function>sd_session_get_remote_host()</function>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering may be used to determine the remote hostname of the
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering session identified by the specified session
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering identifier. The returned string needs to be
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering freed with the libc
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering call after use.</para>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering <para><function>sd_session_get_remote_user()</function>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering may be used to determine the remote username of the
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering session identified by the specified session
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering identifier. The returned string needs to be
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering freed with the libc
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering call after use. Note that this value is rarely known
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering to the system, and even then should not be relied on.</para>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering <para><function>sd_session_get_tty()</function>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering may be used to determine the TTY device of the
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering session identified by the specified session
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering identifier. The returned string needs to be
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering freed with the libc
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering <citerefentry><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
99d4f5e5c0d2532159542519e683f976f881f0f5Lennart Poettering call after use.</para>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <para><function>sd_session_get_vt()</function>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering may be used to determine the VT number of the
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering session identified by the specified session
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering identifier. This function will return an error if
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering the seat does not support VTs.</para>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <para>If the <varname>session</varname> parameter of
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering any of these functions is passed as
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <constant>NULL</constant>, the operation is executed
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering for the session the calling process is a member of, if
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering there is any.</para>
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <para>If the test succeeds,
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <function>sd_session_is_active()</function> and
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering <function>sd_session_is_remote()</function> return a
78f22b973fa2c9b09bd974680836df17163d9ee0Lennart Poettering positive integer; if it fails, 0. On success,
<constant>libsystemd</constant> <citerefentry><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>