/* Simplest worm program */ main() { for(;;) if (fork()!=NUL) exit(); } /* fork() creates an identical copy of the calling process. It returns the process ID of the child process to the parent task, and returns NULL to the child task. This code fragment creates a new process with fork(). The process that called fork() is returned the process ID, so it goes on to exit. The process created with fork() is returned NULL, so continues, and loops back to do it's own fork(). This causes a process that continously changes its process number. In fact, a simpler version would be: main() { for (;;) fork(); } */