Add a helper function cgroup_is_systemd_enabled(), that would return
true, when compiled with --enabled-systemd option or false when
disabled.
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
int cgroup_write_systemd_default_cgroup(const char * const slice,
const char * const scope);
+/*
+ * Return true if systemd support is compiled into the libcgroup library
+ */
+bool cgroup_is_systemd_enabled(void);
+
#ifdef __cplusplus
} /* extern "C" */
#endif
return ret;
}
+
+bool cgroup_is_systemd_enabled(void)
+{
+ return true;
+}
#else
int cgroup_set_default_scope_opts(struct cgroup_systemd_scope_opts * const opts)
{
cgroup_err("Systemd support not compiled\n");
return 1;
}
+
+bool cgroup_is_systemd_enabled(void)
+{
+ return false;
+}
#endif