summaryrefslogtreecommitdiff
path: root/src/login/logind-inhibit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-05 00:34:48 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-05 00:36:08 +0200
commiteecd1362f7f4de432483b5d77c56726c3621a83a (patch)
treee8f1f3639121d317660cc6cc0d5ffe8f8731a39f /src/login/logind-inhibit.h
parenta26336da875a6657d404d1e44b86ae067c34b110 (diff)
logind: implement delay inhibitor locks in addition to block inhibitor locks
This is useful to allow applications to synchronously save data before the system is suspended or shut down.
Diffstat (limited to 'src/login/logind-inhibit.h')
-rw-r--r--src/login/logind-inhibit.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h
index 1d47cfc68d..823af39918 100644
--- a/src/login/logind-inhibit.h
+++ b/src/login/logind-inhibit.h
@@ -37,6 +37,13 @@ typedef enum InhibitWhat {
_INHIBIT_WHAT_INVALID = -1
} InhibitWhat;
+typedef enum InhibitMode {
+ INHIBIT_BLOCK,
+ INHIBIT_DELAY,
+ _INHIBIT_MODE_MAX,
+ _INHIBIT_MODE_INVALID = -1
+} InhibitMode;
+
struct Inhibitor {
Manager *manager;
@@ -48,6 +55,7 @@ struct Inhibitor {
InhibitWhat what;
char *who;
char *why;
+ InhibitMode mode;
pid_t pid;
uid_t uid;
@@ -70,10 +78,13 @@ int inhibitor_stop(Inhibitor *i);
int inhibitor_create_fifo(Inhibitor *i);
void inhibitor_remove_fifo(Inhibitor *i);
-InhibitWhat manager_inhibit_what(Manager *m);
-bool manager_is_inhibited(Manager *m, InhibitWhat w, dual_timestamp *since);
+InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm);
+bool manager_is_inhibited(Manager *m, InhibitWhat w, InhibitMode mm, dual_timestamp *since);
const char *inhibit_what_to_string(InhibitWhat k);
InhibitWhat inhibit_what_from_string(const char *s);
+const char *inhibit_mode_to_string(InhibitMode k);
+InhibitMode inhibit_mode_from_string(const char *s);
+
#endif