]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/kill.h
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / src / core / kill.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
4819ff03
LP
2#pragma once
3
4819ff03
LP
4typedef struct KillContext KillContext;
5
6#include <stdbool.h>
7#include <stdio.h>
8
44a6b1b6
ZJS
9#include "macro.h"
10
4819ff03 11typedef enum KillMode {
c74f17d9 12 /* The kill mode is a property of a unit. */
4819ff03
LP
13 KILL_CONTROL_GROUP = 0,
14 KILL_PROCESS,
58ea275a 15 KILL_MIXED,
4819ff03
LP
16 KILL_NONE,
17 _KILL_MODE_MAX,
18 _KILL_MODE_INVALID = -1
19} KillMode;
20
21struct KillContext {
22 KillMode kill_mode;
23 int kill_signal;
24 bool send_sigkill;
82659fd7 25 bool send_sighup;
4819ff03
LP
26};
27
28typedef enum KillWho {
c74f17d9 29 /* Kill who is a property of an operation */
4819ff03
LP
30 KILL_MAIN,
31 KILL_CONTROL,
32 KILL_ALL,
ac5e3a50
JS
33 KILL_MAIN_FAIL,
34 KILL_CONTROL_FAIL,
35 KILL_ALL_FAIL,
4819ff03
LP
36 _KILL_WHO_MAX,
37 _KILL_WHO_INVALID = -1
38} KillWho;
39
40void kill_context_init(KillContext *c);
41void kill_context_dump(KillContext *c, FILE *f, const char *prefix);
42
44a6b1b6
ZJS
43const char *kill_mode_to_string(KillMode k) _const_;
44KillMode kill_mode_from_string(const char *s) _pure_;
4819ff03 45
44a6b1b6
ZJS
46const char *kill_who_to_string(KillWho k) _const_;
47KillWho kill_who_from_string(const char *s) _pure_;