On Mon Jan 26 03:43:36 PST 2015, aris...@ar.aichi-u.ac.jp wrote: > Hello, > > I have been playing the following program. > I tried on official plan9, 9front, and 9atom. > none of them showed messages that come from: > sysfatal("fork: %r”); > sysfatal("exec: %r"); > I suspect that > fork() > does not return -1 even if it failed in creating new process.
exactly. the reason it never returns -1, is that introduces a new failure case in every program running, and testing seems like a huge pain. just testing for "handles fork returning -1" is not good enough, it has to have a reasonable strategy for deailing with no procs. this is hard to get right. just reboot. i have never been able to recover a system that hit noprocs. i ended up wasting people's time trying. - erik ps. how may lines like this have you seen. p = malloc(n); if(p == nil){ ... } is this really useful in most tools?