Create a unique tmp directory the caller will own; returns 0 on success. */
| 138 | |
| 139 | /* Create a unique tmp directory the caller will own; returns 0 on success. */ |
| 140 | static int cgroup_test_setup(char *root, size_t root_sz) { |
| 141 | strncpy(root, "/tmp/cbm_cgroup_test_XXXXXX", root_sz); |
| 142 | return mkdtemp(root) != NULL ? 0 : -1; |
| 143 | } |
| 144 | |
| 145 | /* Write `content` to "<root>/<relpath>". Creates parent subdir if needed. |
| 146 | * Returns 0 on success, -1 on any failure. */ |