foundry
Foundry OS: the operating system built on the Rustbelt kernel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | /* orphan: checks that init adopts and reaps orphans (boot contract v2).
*
* A process whose parent exits first is an "orphan". Unix hands orphans to
* pid 1 (init), which must wait() for them when they exit; otherwise each
* would stay a "zombie" forever. Rustbelt does this only when pid 1 is
* named "init" -- Foundry OS's /sbin/init.
*
* orphan (this process)
* `-- middle exits at once, leaving...
* `-- grandchild ...an orphan: its parent becomes pid 1
*
* Checks: the grandchild's getppid() becomes 1, and after it exits it is
* gone completely (kill(pid, 0) fails with ESRCH): init reaped it.
* Exit code = number of failed checks. Built static-PIE by foundry-cc.
*/
static int failed;
static void
static void
int
|