+ while ((p = wait(&status)) >= 0) {
+ short code = WEXITSTATUS(status);
+ if (WIFSIGNALED(status)) {
+ kprintf(KINFO "Process %d terminated by signal, exit_code: %d\n",
+ p,
+ code);
+ } else if (WIFEXITED(status)) {
+ kprintf(KINFO "Process %d exited with code %d\n", p, code);
+ } else {
+ kprintf(KWARN "Process %d aborted with code %d\n", p, code);
+ }
+ }
+