X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemd%2Fsd-login.h;h=d05424dbf3b5580f9ddd3ad3668e095272d9387a;hp=bddc74e729404fb9d5541e1a55b850561d77994c;hb=c784c5ce777f16ee56086a072dc1466639bc9eff;hpb=0604381b9dbef4cc498b5a77311e1da99c1430b8 diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h index bddc74e72..d05424dbf 100644 --- a/src/systemd/sd-login.h +++ b/src/systemd/sd-login.h @@ -23,6 +23,7 @@ ***/ #include +#include #ifdef __cplusplus extern "C" { @@ -44,6 +45,8 @@ extern "C" { * These functions access data in /proc, /sys/fs/cgroup and /run. All * of these are virtual file systems, hence the accesses are * relatively cheap. + * + * See sd-login(3) for more information. */ /* Get session from PID. Note that 'shared' processes of a user are @@ -106,6 +109,9 @@ int sd_session_get_class(const char *session, char **clazz); /* Determine the X11 display of this session. */ int sd_session_get_display(const char *session, char **display); +/* Determine the TTY of this session. */ +int sd_session_get_tty(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); @@ -117,6 +123,12 @@ int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **uid, unsign /* Return whether the seat is multi-session capable */ int sd_seat_can_multi_session(const char *seat); +/* Return whether the seat is TTY capable, i.e. suitable for showing console UIs */ +int sd_seat_can_tty(const char *seat); + +/* Return whether the seat is graphics capable, i.e. suitable for showing graphical UIs */ +int sd_seat_can_graphical(const char *seat); + /* Get all seats, store in *seats. Returns the number of seats. If * seats is NULL only returns number of seats. */ int sd_get_seats(char ***seats); @@ -145,6 +157,12 @@ int sd_login_monitor_flush(sd_login_monitor *m); /* Get FD from monitor */ int sd_login_monitor_get_fd(sd_login_monitor *m); +/* Get poll() mask to monitor */ +int sd_login_monitor_get_events(sd_login_monitor *m); + +/* Get timeout for poll(), as usec value relative to CLOCK_MONOTONIC's epoch */ +int sd_login_monitor_get_timeout(sd_login_monitor *m, uint64_t *timeout_usec); + #ifdef __cplusplus } #endif