mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
f269099a7e
Syscall name_to_handle_at() can be used to get cgroup id for a particular cgroup path in user space. The selftest got cgroup id from both user and kernel, and compare to ensure they are equal to each other. Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
19 lines
521 B
C
19 lines
521 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __CGROUP_HELPERS_H
|
|
#define __CGROUP_HELPERS_H
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
|
|
#define clean_errno() (errno == 0 ? "None" : strerror(errno))
|
|
#define log_err(MSG, ...) fprintf(stderr, "(%s:%d: errno: %s) " MSG "\n", \
|
|
__FILE__, __LINE__, clean_errno(), ##__VA_ARGS__)
|
|
|
|
|
|
int create_and_get_cgroup(char *path);
|
|
int join_cgroup(char *path);
|
|
int setup_cgroup_environment(void);
|
|
void cleanup_cgroup_environment(void);
|
|
unsigned long long get_cgroup_id(char *path);
|
|
|
|
#endif
|