1SD_SEAT_GET_ACTIVE(3)         sd_seat_get_active         SD_SEAT_GET_ACTIVE(3)
2
3
4

NAME

6       sd_seat_get_active, sd_seat_get_sessions, sd_seat_can_multi_session,
7       sd_seat_can_tty, sd_seat_can_graphical - Determine state of a specific
8       seat
9

SYNOPSIS

11       #include <systemd/sd-login.h>
12
13       int sd_seat_get_active(const char *seat, char **session, uid_t *uid);
14
15       int sd_seat_get_sessions(const char *seat, char ***sessions,
16                                uid_t **uid, unsigned int *n_uids);
17
18       int sd_seat_can_multi_session(const char *seat);
19
20       int sd_seat_can_tty(const char *seat);
21
22       int sd_seat_can_graphical(const char *seat);
23

DESCRIPTION

25       sd_seat_get_active() may be used to determine which session is
26       currently active on a seat, if there is any. Returns the session
27       identifier and the user identifier of the Unix user the session is
28       belonging to. Either the session or the user identifier parameter can
29       be passed NULL, in case only one of the parameters shall be queried.
30       The returned string needs to be freed with the libc free(3) call after
31       use.
32
33       sd_seat_get_sessions() may be used to determine all sessions on the
34       specified seat. Returns two arrays, one (NULL terminated) with the
35       session identifiers of the sessions and one with the user identifiers
36       of the Unix users the sessions belong to. An additional parameter may
37       be used to return the number of entries in the latter array. This value
38       is the same the return value, if the latter is nonnegative. The two
39       arrays and the last parameter may be passed as NULL in case these
40       values need not to be determined. The arrays and the strings referenced
41       by them need to be freed with the libc free(3) call after use. Note
42       that instead of an empty array NULL may be returned and should be
43       considered equivalent to an empty array.
44
45       sd_seat_can_multi_session() may be used to determine whether a specific
46       seat is capable of multi-session, i.e. allows multiple login sessions
47       in parallel (with only one being active at a time).
48
49       sd_seat_can_tty() may be used to determine whether a specific seat
50       provides TTY functionality, i.e. is useful as a text console.
51
52       sd_seat_can_graphical() may be used to determine whether a specific
53       seat provides graphics functionality, i.e. is useful as a graphics
54       display.
55
56       If the seat parameter of any of these functions is passed as NULL, the
57       operation is executed for the seat of the session of the calling
58       process, if there is any.
59

RETURN VALUE

61       On success, sd_seat_get_active() returns 0 or a positive integer. On
62       success, sd_seat_get_sessions() returns the number of entries in the
63       session identifier array. If the test succeeds,
64       sd_seat_can_multi_session, sd_seat_can_tty and sd_seat_can_graphical
65       return a positive integer, if it fails 0. On failure, these calls
66       return a negative errno-style error code.
67

ERRORS

69       Returned errors may indicate the following problems:
70
71       -ENODATA
72           The given field is not specified for the described seat.
73
74       -ENXIO
75           The specified seat is unknown.
76
77       -EINVAL
78           An input parameter was invalid (out of range, or NULL, where that
79           is not accepted).
80
81       -ENOMEM
82           Memory allocation failed.
83

NOTES

85       These APIs are implemented as a shared library, which can be compiled
86       and linked to with the libsystemd pkg-config(1) file.
87

SEE ALSO

89       systemd(1), sd-login(3), sd_session_get_seat(3)
90
91
92
93systemd 239                                              SD_SEAT_GET_ACTIVE(3)
Impressum