]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/scope.h
Merge pull request #13365 from keszybz/fix-commits-from-pr-13246
[thirdparty/systemd.git] / src / core / scope.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
6c12b52e
LP
2#pragma once
3
6c12b52e
LP
4typedef struct Scope Scope;
5
9ce93478 6#include "cgroup.h"
6c12b52e 7#include "kill.h"
9ce93478 8#include "unit.h"
6c12b52e 9
6c12b52e
LP
10typedef enum ScopeResult {
11 SCOPE_SUCCESS,
12 SCOPE_FAILURE_RESOURCES,
13 SCOPE_FAILURE_TIMEOUT,
14 _SCOPE_RESULT_MAX,
15 _SCOPE_RESULT_INVALID = -1
16} ScopeResult;
17
18struct Scope {
19 Unit meta;
20
21 CGroupContext cgroup_context;
22 KillContext kill_context;
23
24 ScopeState state, deserialized_state;
25 ScopeResult result;
26
27 usec_t timeout_stop_usec;
28
2d4a39e7 29 char *controller;
371c0b79
LP
30 sd_bus_track *controller_track;
31
3862e809 32 bool was_abandoned;
2d4a39e7 33
718db961 34 sd_event_source *timer_event_source;
6c12b52e
LP
35};
36
37extern const UnitVTable scope_vtable;
38
a911bb9a
LP
39int scope_abandon(Scope *s);
40
6c12b52e
LP
41const char* scope_result_to_string(ScopeResult i) _const_;
42ScopeResult scope_result_from_string(const char *s) _pure_;
57b7a260
FS
43
44DEFINE_CAST(SCOPE, Scope);