From dace83cbd0c2212fc0e25d36d50711b19f14b1b6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 4 Apr 2013 17:38:08 +0200 Subject: login: add new public API call sd_login_monitor_get_events() to get poll() flags to wait for We should keep our options open, so that we can watch for POLLOUT later on if we wish to. CUrrently this call will always return POLLIN however. --- man/sd_login_monitor_new.xml | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) (limited to 'man/sd_login_monitor_new.xml') diff --git a/man/sd_login_monitor_new.xml b/man/sd_login_monitor_new.xml index 2c4d05dcb9..94428771a8 100644 --- a/man/sd_login_monitor_new.xml +++ b/man/sd_login_monitor_new.xml @@ -47,6 +47,7 @@ sd_login_monitor_unref sd_login_monitor_flush sd_login_monitor_get_fd + sd_login_monitor_get_events sd_login_monitor Monitor login sessions, seats and users @@ -76,6 +77,11 @@ sd_login_monitor* m + + int sd_login_monitor_get_events + sd_login_monitor* m + + @@ -122,14 +128,24 @@ application defined event loop, based around poll2 or a similar interface. The application should include - the returned file descriptor as wake up source for - POLLIN events. Whenever a wake-up is triggered the - file descriptor needs to be reset via + the returned file descriptor as wake-up source for the + events mask returned by + sd_login_monitor_get_events(). Whenever + a wake-up is triggered the file descriptor needs to be + reset via sd_login_monitor_flush(). An application needs to reread the login state with a function like sd_get_seats3 or similar to determine what changed. + + sd_login_monitor_get_events() + will return the poll() mask to + wait for. This function will return a combination of + POLLIN, POLLOUT + and similar to fill into the + .events field of struct + pollfd. @@ -140,8 +156,12 @@ sd_login_monitor_flush() return 0 or a positive integer. On success sd_login_monitor_get_fd() returns - a Unix file descriptor. On failure, these calls return - a negative errno-style error code. + a Unix file descriptor. On success + sd_login_monitor_get_events() + returns a combination of POLLIN, + POLLOUT and suchlike. On failure, + these calls return a negative errno-style error + code. sd_login_monitor_unref() always returns NULL. @@ -151,10 +171,12 @@ Notes The sd_login_monitor_new(), - sd_login_monitor_unref(), sd_login_monitor_flush() and - sd_login_monitor_get_fd() interfaces - are available as shared library, which can be compiled - and linked to with the + sd_login_monitor_unref(), + sd_login_monitor_flush(), + sd_login_monitor_get_fd() and + sd_login_monitor_get_events() + interfaces are available as shared library, which can + be compiled and linked to with the libsystemd-login pkg-config1 file. @@ -166,7 +188,8 @@ systemd1, sd-login3, - sd_get_seats3 + sd_get_seats3, + poll2 -- cgit v1.2.3-54-g00ecf