]> git.proxmox.com Git - systemd.git/blob - man/sd_get_seats.3
Imported Upstream version 220
[systemd.git] / man / sd_get_seats.3
1 '\" t
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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
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
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-login\&.h>
29 .fi
30 .ft
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" ");"
39 .SH "DESCRIPTION"
40 .PP
41 \fBsd_get_seats()\fR
42 may be used to determine all currently available local seats\&. Returns a
43 \fBNULL\fR
44 terminated array of seat identifiers\&. The returned array and all strings it references need to be freed with the libc
45 \fBfree\fR(3)
46 call after use\&. Note that instead of an empty array
47 \fBNULL\fR
48 may be returned and should be considered equivalent to an empty array\&.
49 .PP
50 Similarly,
51 \fBsd_get_sessions()\fR
52 may be used to determine all current login sessions\&.
53 .PP
54 Similarly,
55 \fBsd_get_uids()\fR
56 may be used to determine all Unix users who currently have login sessions\&.
57 .PP
58 Similarly,
59 \fBsd_get_machine_names()\fR
60 may be used to determine all current virtual machines and containers on the system\&.
61 .PP
62 Note that the returned lists are not sorted and in an undefined order\&.
63 .SH "RETURN VALUE"
64 .PP
65 On success,
66 \fBsd_get_seats()\fR,
67 \fBsd_get_sessions()\fR,
68 \fBsd_get_uids()\fR
69 and
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\&.
72 .SH "NOTES"
73 .PP
74 The
75 \fBsd_get_seats()\fR,
76 \fBsd_get_sessions()\fR,
77 \fBsd_get_uids()\fR
78 and
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)
82 file\&.
83 .SH "SEE ALSO"
84 .PP
85 \fBsystemd\fR(1),
86 \fBsd-login\fR(3),
87 \fBsd_session_get_seat\fR(3)