1 /* Recursively executes itself until the child fails to execute.
2 We expect that at least 15 copies can run.
3 We also require that, if a process doesn't actually get to
4 start, exec() must return -1, not a valid PID. */
10 #include "tests/lib.h"
12 const char *test_name = "multi-oom";
15 main (int argc UNUSED, char *argv[])
27 snprintf (child_cmd, sizeof child_cmd, "multi-oom %d", n + 1);
28 child_pid = exec (child_cmd);
31 int code = wait (child_pid);
33 fail ("wait(exec(\"%s\")) returned %d", child_cmd, code);
36 fail ("exec(\"%s\") returned -1 after only %d recursions", child_cmd, n);