![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
In the second year of my BSc, one of the lecturers asked us to build a Unix shell. In those days, Unix on PCs was a novelty, and most people used accounts on a minicomputer called altair. (Now I feel old.)
Anyway, a fundamental part of building a shell is the sequence of fork() then exec(). It's unique to Unix-like systems, and most students were unfamiliar with it-- hence the exercise.
Now, if you miss out the exec(), you'll have a continuous loop of fork()s, otherwise known as a fork bomb. This could bring down the system, especially in those days. So imagine several dozen CS2 students logging in to the same computer, building a fork bomb by accident, and setting it off.
The funniest part was how angry he was with *us* in the next lecture. "The sysadmins are saying I told you to put fork() in a loop! I *never* told you to put fork() in a loop!"
Anyway, a fundamental part of building a shell is the sequence of fork() then exec(). It's unique to Unix-like systems, and most students were unfamiliar with it-- hence the exercise.
Now, if you miss out the exec(), you'll have a continuous loop of fork()s, otherwise known as a fork bomb. This could bring down the system, especially in those days. So imagine several dozen CS2 students logging in to the same computer, building a fork bomb by accident, and setting it off.
The funniest part was how angry he was with *us* in the next lecture. "The sysadmins are saying I told you to put fork() in a loop! I *never* told you to put fork() in a loop!"