]>
Commit | Line | Data |
---|---|---|
4819ff03 LP |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | #pragma once | |
4 | ||
5 | /*** | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2012 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
11 | under the terms of the GNU Lesser General Public License as published by | |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 | Lesser General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU Lesser General Public License | |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
22 | ***/ | |
23 | ||
24 | typedef struct KillContext KillContext; | |
25 | ||
26 | #include <stdbool.h> | |
27 | #include <stdio.h> | |
28 | ||
29 | typedef enum KillMode { | |
c74f17d9 | 30 | /* The kill mode is a property of a unit. */ |
4819ff03 LP |
31 | KILL_CONTROL_GROUP = 0, |
32 | KILL_PROCESS, | |
33 | KILL_NONE, | |
34 | _KILL_MODE_MAX, | |
35 | _KILL_MODE_INVALID = -1 | |
36 | } KillMode; | |
37 | ||
38 | struct KillContext { | |
39 | KillMode kill_mode; | |
40 | int kill_signal; | |
41 | bool send_sigkill; | |
42 | }; | |
43 | ||
44 | typedef enum KillWho { | |
c74f17d9 | 45 | /* Kill who is a property of an operation */ |
4819ff03 LP |
46 | KILL_MAIN, |
47 | KILL_CONTROL, | |
48 | KILL_ALL, | |
49 | _KILL_WHO_MAX, | |
50 | _KILL_WHO_INVALID = -1 | |
51 | } KillWho; | |
52 | ||
53 | void kill_context_init(KillContext *c); | |
54 | void kill_context_dump(KillContext *c, FILE *f, const char *prefix); | |
55 | ||
56 | const char *kill_mode_to_string(KillMode k); | |
57 | KillMode kill_mode_from_string(const char *s); | |
58 | ||
59 | const char *kill_who_to_string(KillWho k); | |
60 | KillWho kill_who_from_string(const char *s); |