cgroup_helpers.h 436 B

12345678910111213141516
  1. #ifndef __CGROUP_HELPERS_H
  2. #define __CGROUP_HELPERS_H
  3. #include <errno.h>
  4. #include <string.h>
  5. #define clean_errno() (errno == 0 ? "None" : strerror(errno))
  6. #define log_err(MSG, ...) fprintf(stderr, "(%s:%d: errno: %s) " MSG "\n", \
  7. __FILE__, __LINE__, clean_errno(), ##__VA_ARGS__)
  8. int create_and_get_cgroup(char *path);
  9. int join_cgroup(char *path);
  10. int setup_cgroup_environment(void);
  11. void cleanup_cgroup_environment(void);
  12. #endif