forked from rfjakob/earlyoom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkill.h
More file actions
27 lines (23 loc) · 775 Bytes
/
kill.h
File metadata and controls
27 lines (23 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: MIT */
#ifndef KILL_H
#define KILL_H
#include <stdbool.h>
typedef struct {
/* if the available memory AND swap goes below these percentages,
* we start killing processes */
int mem_term_percent;
int mem_kill_percent;
int swap_term_percent;
int swap_kill_percent;
/* ignore /proc/PID/oom_score_adj? */
bool ignore_oom_score_adj;
/* notifcation command to launch when killing something. NULL = no-op. */
char* notif_command;
/* prefer/avoid killing these processes. NULL = no-op. */
regex_t* prefer_regex;
regex_t* avoid_regex;
/* memory report interval, in milliseconds */
int report_interval_ms;
} poll_loop_args_t;
void kill_largest_process(poll_loop_args_t args, int sig);
#endif