summaryrefslogtreecommitdiffstats
path: root/jail/cgroups.h
blob: 2c6f69092b93fe4f3064f41972d4e5509b73437b (plain)
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
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright (C) 2020 Daniel Golle <daniel@makrotopia.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 2.1
 * as published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _JAIL_CGROUPS_H
#define _JAIL_CGROUPS_H

#include <stdbool.h>
#include <stdint.h>

void cgroups_init(const char *p);
int parseOCIlinuxcgroups(struct blob_attr *msg, bool is_update);
void cgroups_create(void);
void cgroups_destroy(void);
void cgroups_configure(void);
void cgroups_apply(pid_t pid);
int cgroups_attach_pid(pid_t pid);
int cgroups_kill_all(void);
int cgroups_set_frozen(bool frozen);
int cgroups_reclaim(int64_t bytes, int32_t swappiness);
int64_t cgroups_read_int64(const char *attr);
int cgroups_open_attr(const char *attr);
int cgroups_open_dir(void);
void cgroups_free(void);
void cgroups_prepare(void);
void cgroups_set_memory_limit(int64_t bytes);

#endif