Sargun Dhillon | 1a922fe | 2016-12-02 02:42:18 -0800 | [diff] [blame] | 1 | #ifndef __CGROUP_HELPERS_H |
| 2 | #define __CGROUP_HELPERS_H |
| 3 | #include <errno.h> |
| 4 | #include <string.h> |
| 5 | |
| 6 | #define clean_errno() (errno == 0 ? "None" : strerror(errno)) |
| 7 | #define log_err(MSG, ...) fprintf(stderr, "(%s:%d: errno: %s) " MSG "\n", \ |
| 8 | __FILE__, __LINE__, clean_errno(), ##__VA_ARGS__) |
| 9 | |
| 10 | |
| 11 | int create_and_get_cgroup(char *path); |
| 12 | int join_cgroup(char *path); |
| 13 | int setup_cgroup_environment(void); |
| 14 | void cleanup_cgroup_environment(void); |
| 15 | |
| 16 | #endif |