]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/scope.h
Merge pull request #8676 from keszybz/drop-license-boilerplate
[thirdparty/systemd.git] / src / core / scope.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5 This file is part of systemd.
6
7 Copyright 2013 Lennart Poettering
8 ***/
9
10 typedef struct Scope Scope;
11
12 #include "cgroup.h"
13 #include "kill.h"
14 #include "unit.h"
15
16 typedef enum ScopeResult {
17 SCOPE_SUCCESS,
18 SCOPE_FAILURE_RESOURCES,
19 SCOPE_FAILURE_TIMEOUT,
20 _SCOPE_RESULT_MAX,
21 _SCOPE_RESULT_INVALID = -1
22 } ScopeResult;
23
24 struct Scope {
25 Unit meta;
26
27 CGroupContext cgroup_context;
28 KillContext kill_context;
29
30 ScopeState state, deserialized_state;
31 ScopeResult result;
32
33 usec_t timeout_stop_usec;
34
35 char *controller;
36 sd_bus_track *controller_track;
37
38 bool was_abandoned;
39
40 sd_event_source *timer_event_source;
41 };
42
43 extern const UnitVTable scope_vtable;
44
45 int scope_abandon(Scope *s);
46
47 const char* scope_result_to_string(ScopeResult i) _const_;
48 ScopeResult scope_result_from_string(const char *s) _pure_;