/* * Copyright (C) 2020 Daniel Golle * * 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 #include 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