7 ms·
Will it quit? A failed fork() will return -1, which is non-zero thus true in a boolean context. The while(fork()) {...} will run.
by jimm 12y ago
Will it quit? A failed fork() will return -1, which is non-zero thus true in a boolean context. The while(fork()) {...} will run.
- comex 12y agoBut it will stop when fork returns 0, i.e. in the child processes, making it non-exponential.