1SD_GET_SEATS(3) sd_get_seats SD_GET_SEATS(3)
2
3
4
6 sd_get_seats, sd_get_sessions, sd_get_uids, sd_get_machine_names -
7 Determine available seats, sessions, logged in users and virtual
8 machines/containers
9
11 #include <systemd/sd-login.h>
12
13 int sd_get_seats(char ***seats);
14
15 int sd_get_sessions(char ***sessions);
16
17 int sd_get_uids(uid_t **users);
18
19 int sd_get_machine_names(char ***machines);
20
22 sd_get_seats() may be used to determine all currently available local
23 seats. Returns a NULL terminated array of seat identifiers. The
24 returned array and all strings it references need to be freed with the
25 libc free(3) call after use. Note that instead of an empty array NULL
26 may be returned and should be considered equivalent to an empty array.
27
28 Similarly, sd_get_sessions() may be used to determine all current login
29 sessions.
30
31 Similarly, sd_get_uids() may be used to determine all Unix users who
32 currently have login sessions.
33
34 Similarly, sd_get_machine_names() may be used to determine all current
35 virtual machines and containers on the system.
36
37 Note that the returned lists are not sorted and in an undefined order.
38
40 On success, sd_get_seats(), sd_get_sessions(), sd_get_uids() and
41 sd_get_machine_names() return the number of entries in the arrays. On
42 failure, these calls return a negative errno-style error code.
43
45 The sd_get_seats(), sd_get_sessions(), sd_get_uids() and
46 sd_get_machine_names() interfaces are available as a shared library,
47 which can be compiled and linked to with the libsystemd pkg-config(1)
48 file.
49
51 systemd(1), sd-login(3), sd_session_get_seat(3)
52
53
54
55systemd 219 SD_GET_SEATS(3)