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