| 57 | } |
| 58 | |
| 59 | static int next_num(const char *str, char **end, int *result) { |
| 60 | if (!str || *str == '\0' || !isdigit(*str)) |
| 61 | return -1; |
| 62 | |
| 63 | *result = strtoul(str, end, 10); |
| 64 | if (str == *end) |
| 65 | return -1; |
| 66 | |
| 67 | return 0; |
| 68 | } |
| 69 | |
| 70 | /* set current thread cpu affinity to cpu list, this function works like |
| 71 | * taskset command (actually cpulist parsing logic reference to util-linux). |