| J de Boyne Pollard 2007-10-24, 7:18 pm |
| MR> #include <stdlib.h>
MR> #include <unistd.h>
MR>
MR> int main(int argc, char **argv)
MR> {
MR> for(;;)
MR> if(fork())
MR> _exit(0);
MR> return 0;
MR> }
SW> [...]
SW> On the other hand, if there is no portable way, this could
SW> serve as a nice test for managers to find out good
SW> administrators for heterogenous unix networks: deploy
SW> the process via ssh on all the boxes and see on which
SW> unices he can manage to stop it ;)
JdeBP> Not really. As I wrote before: killpg() is your friend.
JdeBP> The hardest part of your test is determining how to
JdeBP> persuade each system's "ps" command to print out
JdeBP> process group IDs. (Reading the manual page for
JdeBP> "ps" was the part that took me the longest, at any
JdeBP> rate.)
f> So try that on my version of the "fork machinegun":
Control-Q (or whatever your terminal's stop character happens to be)
is your friend for that one. As, indeed, is a pipe.
|