diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/login/libsystemd-login.sym | 5 | ||||
-rw-r--r-- | src/login/sd-login.c | 9 | ||||
-rw-r--r-- | src/login/test-login.c | 2 | ||||
-rw-r--r-- | src/systemd/sd-login.h | 3 |
4 files changed, 18 insertions, 1 deletions
diff --git a/src/login/libsystemd-login.sym b/src/login/libsystemd-login.sym index 272b0e2b52..55a828773b 100644 --- a/src/login/libsystemd-login.sym +++ b/src/login/libsystemd-login.sym @@ -58,3 +58,8 @@ LIBSYSTEMD_LOGIN_198 { global: sd_session_get_tty; } LIBSYSTEMD_LOGIN_186; + +LIBSYSTEMD_LOGIN_201 { +global: + sd_login_monitor_get_events; +} LIBSYSTEMD_LOGIN_198; diff --git a/src/login/sd-login.c b/src/login/sd-login.c index 8867e8c8eb..861a57166d 100644 --- a/src/login/sd-login.c +++ b/src/login/sd-login.c @@ -23,6 +23,7 @@ #include <string.h> #include <errno.h> #include <sys/inotify.h> +#include <sys/poll.h> #include "util.h" #include "cgroup-util.h" @@ -797,3 +798,11 @@ _public_ int sd_login_monitor_get_fd(sd_login_monitor *m) { return MONITOR_TO_FD(m); } + +_public_ int sd_login_monitor_get_events(sd_login_monitor *m) { + + if (!m) + return -EINVAL; + + return POLLIN; +} diff --git a/src/login/test-login.c b/src/login/test-login.c index 159ff3efc5..f639129636 100644 --- a/src/login/test-login.c +++ b/src/login/test-login.c @@ -185,7 +185,7 @@ int main(int argc, char* argv[]) { zero(pollfd); pollfd.fd = sd_login_monitor_get_fd(m); - pollfd.events = POLLIN; + pollfd.events = sd_login_monitor_get_events(m); for (n = 0; n < 5; n++) { r = poll(&pollfd, 1, -1); diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h index 3746b45cf3..57255bd4a9 100644 --- a/src/systemd/sd-login.h +++ b/src/systemd/sd-login.h @@ -156,6 +156,9 @@ 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); + #ifdef __cplusplus } #endif |