Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / tools / testing / selftests / bpf / cgroup_helpers.h
blob06485e0002b3b797ccfaeadd9c38ce6b8706f61c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __CGROUP_HELPERS_H
3 #define __CGROUP_HELPERS_H
4 #include <errno.h>
5 #include <string.h>
7 #define clean_errno() (errno == 0 ? "None" : strerror(errno))
8 #define log_err(MSG, ...) fprintf(stderr, "(%s:%d: errno: %s) " MSG "\n", \
9 __FILE__, __LINE__, clean_errno(), ##__VA_ARGS__)
12 int create_and_get_cgroup(char *path);
13 int join_cgroup(char *path);
14 int setup_cgroup_environment(void);
15 void cleanup_cgroup_environment(void);
17 #endif