]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/kill.h
core: drop KillMode parameter from KillUnit() bus call
[thirdparty/systemd.git] / src / core / kill.h
CommitLineData
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
24typedef struct KillContext KillContext;
25
26#include <stdbool.h>
27#include <stdio.h>
28
29typedef 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
38struct KillContext {
39 KillMode kill_mode;
40 int kill_signal;
41 bool send_sigkill;
42};
43
44typedef 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
53void kill_context_init(KillContext *c);
54void kill_context_dump(KillContext *c, FILE *f, const char *prefix);
55
56const char *kill_mode_to_string(KillMode k);
57KillMode kill_mode_from_string(const char *s);
58
59const char *kill_who_to_string(KillWho k);
60KillWho kill_who_from_string(const char *s);