-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcgroup.h
More file actions
20 lines (16 loc) · 728 Bytes
/
cgroup.h
File metadata and controls
20 lines (16 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef CGROUP_H
#define CGROUP_H
#include <sys/types.h>
#define CGFS_BASE "/sys/fs/cgroup"
#define CGFS_NAME "sscts"
#define ensure_cgroup(name) _ensure_cgroup(CGFS_BASE "/" name "/" CGFS_NAME)
int _ensure_cgroup(const char *group_name_full);
int init_cgroup(const char *group_name_full);
int setup_cgroup(const char *group_name, char *sub_group,unsigned t);
int add_pid_to_cg(pid_t pid, const char *sub_group);
int get_cg_result(const char *name, const char *sub_group, size_t *result);
int cleanup_cg(const char *sub_group);
int force_empty_mem(const char *sub_group);
int flush(const char *sub_group, const char *name);
int write_cgroup(const char *sub_group, const char *name, const char *content);
#endif // CGROUP_H