]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
6c12b52e LP |
2 | #pragma once |
3 | ||
4 | /*** | |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright 2013 Lennart Poettering | |
6c12b52e LP |
8 | ***/ |
9 | ||
10 | typedef struct Scope Scope; | |
11 | ||
9ce93478 | 12 | #include "cgroup.h" |
6c12b52e | 13 | #include "kill.h" |
9ce93478 | 14 | #include "unit.h" |
6c12b52e | 15 | |
6c12b52e LP |
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 | ||
2d4a39e7 | 35 | char *controller; |
371c0b79 LP |
36 | sd_bus_track *controller_track; |
37 | ||
3862e809 | 38 | bool was_abandoned; |
2d4a39e7 | 39 | |
718db961 | 40 | sd_event_source *timer_event_source; |
6c12b52e LP |
41 | }; |
42 | ||
43 | extern const UnitVTable scope_vtable; | |
44 | ||
a911bb9a LP |
45 | int scope_abandon(Scope *s); |
46 | ||
6c12b52e LP |
47 | const char* scope_result_to_string(ScopeResult i) _const_; |
48 | ScopeResult scope_result_from_string(const char *s) _pure_; |