#ifndef __HELP_FUN_H__ #define __HELP_FUN_H__ #include #include // for isspace #include #include #include #include #include #include #include // for read #include #define BUF_LEN 4096 #define WHITESPACE " \t\n\r" #define strneq(a, b, n) (strncmp((a), (b), (n)) == 0) #define streq(a, b) (strcmp((a), (b)) == 0) #define TASK_RUNNING 0x0000 #define TASK_INTERRUPTIBLE 0x0001 #define TASK_UNINTERRUPTIBLE 0x0002 #define __TASK_STOPPED 0x0004 #define __TASK_TRACED 0x0008 #define TASK_PARKED 0x0040 #define TASK_DEAD 0x0080 #define TASK_WAKEKILL 0x0100 #define TASK_NOLOAD 0x0200 #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) #define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED) #define TASK_IDLE (TASK_UNINTERRUPTIBLE | TASK_NOLOAD) extern unsigned long run_in_host; // 0: container, 1: host int check_in_host(void); // for run_in_host std::string state_str(int __state); // task state to string #endif