1 // Fork a binary tree of processes and display their structure.
7 void forktree(const char *cur
);
10 forkchild(const char *cur
, char branch
)
14 if (strlen(cur
) >= DEPTH
)
17 snprintf(nxt
, DEPTH
+1, "%s%c", cur
, branch
);
25 forktree(const char *cur
)
27 cprintf("%04x: I am '%s'\n", sys_getenvid(), cur
);
30 // Yield to give the child a chance to run.
31 // This will make child environment IDs slightly more predictable.
37 umain(int argc
, char **argv
)