summaryrefslogtreecommitdiff
path: root/src/core/unit.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-28 17:14:59 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-31 13:20:43 +0200
commit35b7ff80e29524cb01f881ca6d52c669970c88f1 (patch)
treeb041bd8084e481a38760152ebf97579656b2c478 /src/core/unit.h
parent6513d561ce4c894ea4e29612a2ed62c8310a164f (diff)
unit: add new macros to test for unit contexts
Diffstat (limited to 'src/core/unit.h')
-rw-r--r--src/core/unit.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/unit.h b/src/core/unit.h
index f53b7f6da1..8da12356f8 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -439,6 +439,10 @@ extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX];
/* For casting the various unit types into a unit */
#define UNIT(u) (&(u)->meta)
+#define UNIT_HAS_EXEC_CONTEXT(u) (UNIT_VTABLE(u)->exec_context_offset > 0)
+#define UNIT_HAS_CGROUP_CONTEXT(u) (UNIT_VTABLE(u)->cgroup_context_offset > 0)
+#define UNIT_HAS_KILL_CONTEXT(u) (UNIT_VTABLE(u)->kill_context_offset > 0)
+
#define UNIT_TRIGGER(u) ((Unit*) set_first((u)->dependencies[UNIT_TRIGGERS]))
DEFINE_CAST(SERVICE, Service);