global:
sd_session_get_type;
sd_session_get_class;
+ sd_session_get_display;
} LIBSYSTEMD_LOGIN_38;
return session_get_string(session, "CLASS", class);
}
+_public_ int sd_session_get_display(const char *session, char **display) {
+ return session_get_string(session, "DISPLAY", display);
+}
+
static int file_of_seat(const char *seat, char **_p) {
char *p;
int r;
int main(int argc, char* argv[]) {
int r, k;
uid_t u, u2;
- char *seat, *type, *class;
+ char *seat, *type, *class, *display;
char *session;
char *state;
char *session2;
printf("class = %s\n", class);
free(class);
+ assert_se(sd_session_get_display(session, &display) >= 0);
+ printf("display = %s\n", display);
+ free(display);
+
assert_se(sd_session_get_seat(session, &seat) >= 0);
printf("seat = %s\n", seat);
/* Determine the class of this session, i.e. one of "user", "greeter" or "lock-screen". */
int sd_session_get_class(const char *session, char **class);
+/* Determine the X11 display of this session. */
+int sd_session_get_display(const char *session, char **display);
+
/* Return active session and user of seat */
int sd_seat_get_active(const char *seat, char **session, uid_t *uid);