X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsd-login.c;h=d44a1fcf9c473487f5e48355f2681659a3305de1;hp=2c5b153fba7eb5fc012c754d3bb0dbfc120606bf;hb=add30678a1bf284ecd79438d219c45ca7a1c9f51;hpb=5780425ea7f4b649852991bc515fa8ce71ee43dd diff --git a/src/sd-login.c b/src/sd-login.c index 2c5b153fb..d44a1fcf9 100644 --- a/src/sd-login.c +++ b/src/sd-login.c @@ -522,6 +522,36 @@ _public_ int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **ui return 0; } +_public_ int sd_seat_can_multi_session(const char *seat) { + char *p, *s = NULL; + int r; + + if (!seat) + return -EINVAL; + + p = strappend("/run/systemd/seats/", seat); + if (!p) + return -ENOMEM; + + r = parse_env_file(p, NEWLINE, + "IS_VTCONSOLE", &s, + NULL); + free(p); + + if (r < 0) { + free(s); + return r; + } + + if (s) { + r = parse_boolean(s); + free(s); + } else + r = 0; + + return r; +} + _public_ int sd_get_seats(char ***seats) { if (!seats)