150 lines
3.4 KiB
HTML
150 lines
3.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SD_GET_SEATS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SD_GET_SEATS</H1>
|
|
Section: sd_get_seats (3)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names - Determine available seats, sessions, logged in users and virtual machines/containers
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<P>
|
|
<B>
|
|
</B><PRE>
|
|
#include <<A HREF="file:///usr/include/systemd/sd-login.h">systemd/sd-login.h</A>>
|
|
</PRE>
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">
|
|
<B>int sd_get_seats(char ***</B><I>seats</I><B>);</B>
|
|
|
|
<DT id="2">
|
|
<B>int sd_get_sessions(char ***</B><I>sessions</I><B>);</B>
|
|
|
|
<DT id="3">
|
|
<B>int sd_get_uids(uid_t **</B><I>users</I><B>);</B>
|
|
|
|
<DT id="4">
|
|
<B>int sd_get_machine_names(char ***</B><I>machines</I><B>);</B>
|
|
|
|
</DL>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
<P>
|
|
|
|
<B>sd_get_seats()</B>
|
|
<DD>may be used to determine all currently available local seats. Returns the number of seat identifiers and if the input pointer is non-NULL, a
|
|
<B>NULL</B>-terminated array of seat identifiers is stored at the address. The returned array and all strings it references need to be freed with the libc
|
|
<B><A HREF="/cgi-bin/man/man2html?3+free">free</A></B>(3)
|
|
call after use. Note that instead of an empty array
|
|
<B>NULL</B>
|
|
may be returned and should be considered equivalent to an empty array.
|
|
<P>
|
|
|
|
Similarly,
|
|
<B>sd_get_sessions()</B>
|
|
may be used to determine all current login sessions.
|
|
<P>
|
|
|
|
Similarly,
|
|
<B>sd_get_uids()</B>
|
|
may be used to determine all Unix users who currently have login sessions.
|
|
<P>
|
|
|
|
Similarly,
|
|
<B>sd_get_machine_names()</B>
|
|
may be used to determine all current virtual machines and containers on the system.
|
|
<P>
|
|
|
|
Note that the returned lists are not sorted and in an undefined order.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>RETURN VALUE</H2>
|
|
|
|
<P>
|
|
|
|
On success,
|
|
<B>sd_get_seats()</B>,
|
|
<B>sd_get_sessions()</B>,
|
|
<B>sd_get_uids()</B>
|
|
and
|
|
<B>sd_get_machine_names()</B>
|
|
return the number of entries in the arrays. On failure, these calls return a negative errno-style error code.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Errors</H3>
|
|
|
|
<P>
|
|
|
|
Returned errors may indicate the following problems:
|
|
<P>
|
|
|
|
<B>-ENOMEM</B>
|
|
<DL COMPACT><DT id="5"><DD>
|
|
Memory allocation failed.
|
|
</DL>
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
<P>
|
|
|
|
These APIs are implemented as a shared library, which can be compiled and linked to with the
|
|
<B>libsystemd</B> <B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
|
|
file.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd-login">sd-login</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+sd_session_get_seat">sd_session_get_seat</A></B>(3)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="9"><A HREF="#lbAE">RETURN VALUE</A><DD>
|
|
<DL>
|
|
<DT id="10"><A HREF="#lbAF">Errors</A><DD>
|
|
</DL>
|
|
<DT id="11"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="12"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:55 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|