]>
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 | |
8 | ||
9 | systemd is free software; you can redistribute it and/or modify it | |
10 | under the terms of the GNU Lesser General Public License as published by | |
11 | the Free Software Foundation; either version 2.1 of the License, or | |
12 | (at your option) any later version. | |
13 | ||
14 | systemd is distributed in the hope that it will be useful, but | |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | Lesser General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU Lesser General Public License | |
20 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
21 | ***/ | |
22 | ||
23 | typedef struct Scope Scope; | |
24 | ||
9ce93478 | 25 | #include "cgroup.h" |
6c12b52e | 26 | #include "kill.h" |
9ce93478 | 27 | #include "unit.h" |
6c12b52e | 28 | |
6c12b52e LP |
29 | typedef enum ScopeResult { |
30 | SCOPE_SUCCESS, | |
31 | SCOPE_FAILURE_RESOURCES, | |
32 | SCOPE_FAILURE_TIMEOUT, | |
33 | _SCOPE_RESULT_MAX, | |
34 | _SCOPE_RESULT_INVALID = -1 | |
35 | } ScopeResult; | |
36 | ||
37 | struct Scope { | |
38 | Unit meta; | |
39 | ||
40 | CGroupContext cgroup_context; | |
41 | KillContext kill_context; | |
42 | ||
43 | ScopeState state, deserialized_state; | |
44 | ScopeResult result; | |
45 | ||
46 | usec_t timeout_stop_usec; | |
47 | ||
2d4a39e7 | 48 | char *controller; |
3862e809 | 49 | bool was_abandoned; |
2d4a39e7 | 50 | |
718db961 | 51 | sd_event_source *timer_event_source; |
6c12b52e LP |
52 | }; |
53 | ||
54 | extern const UnitVTable scope_vtable; | |
55 | ||
a911bb9a LP |
56 | int scope_abandon(Scope *s); |
57 | ||
6c12b52e LP |
58 | const char* scope_result_to_string(ScopeResult i) _const_; |
59 | ScopeResult scope_result_from_string(const char *s) _pure_; |