## forkbomb

#### OS/161 Reference Manual

### Name

forkbomb - create hundreds of processes

### Synopsis

/testbin/forkbomb

### Description

forkbomb does

       while (1) fork();

doing a bit of additional checking similar to that done by forktest.

DO NOT RUN THIS ON A REAL SYSTEM - IT WILL GRIND TO A HALT AND PEOPLE WILL COME AFTER YOU WIELDING BASEBALL BATS AND/OR THE AD BOARD*. WE WARNED YOU.

* The Administrative Board of Harvard College handles formal disciplinary action.

### Requirements

forkbomb uses the following system calls:

- fork
- getpid
- write
- _exit

We don't expect your system to withstand this without grinding to a halt, but once your basic system calls are complete it shouldn't crash. Likewise for after your virtual memory system is complete.

Note that this may turn out to be hard to achieve in practice. Don't spend much time fixing problems forkbomb triggers that won't arise under more normal operation. (If in doubt, consult the course staff.)