2 .TH "SD_GET_SEATS" "3" "" "systemd 220" "sd_get_seats"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
17 .\" disable justification (adjust text to left margin only)
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
23 sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names \- Determine available seats, sessions, logged in users and virtual machines/containers
28 #include <systemd/sd\-login\&.h>
31 .HP \w'int\ sd_get_seats('u
32 .BI "int sd_get_seats(char\ ***" "seats" ");"
33 .HP \w'int\ sd_get_sessions('u
34 .BI "int sd_get_sessions(char\ ***" "sessions" ");"
35 .HP \w'int\ sd_get_uids('u
36 .BI "int sd_get_uids(uid_t\ **" "users" ");"
37 .HP \w'int\ sd_get_machine_names('u
38 .BI "int sd_get_machine_names(char\ ***" "machines" ");"
42 may be used to determine all currently available local seats\&. Returns a
44 terminated array of seat identifiers\&. The returned array and all strings it references need to be freed with the libc
46 call after use\&. Note that instead of an empty array
48 may be returned and should be considered equivalent to an empty array\&.
51 \fBsd_get_sessions()\fR
52 may be used to determine all current login sessions\&.
56 may be used to determine all Unix users who currently have login sessions\&.
59 \fBsd_get_machine_names()\fR
60 may be used to determine all current virtual machines and containers on the system\&.
62 Note that the returned lists are not sorted and in an undefined order\&.
67 \fBsd_get_sessions()\fR,
70 \fBsd_get_machine_names()\fR
71 return the number of entries in the arrays\&. On failure, these calls return a negative errno\-style error code\&.
76 \fBsd_get_sessions()\fR,
79 \fBsd_get_machine_names()\fR
80 interfaces are available as a shared library, which can be compiled and linked to with the
81 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
87 \fBsd_session_get_seat\fR(3)