Comment by outworlder
4 years ago
> 99% of the time you immediately call exec after fork
What about forking servers? listen() and then immediately fork() to handle the inbound connection? Those don't need exec.
Also daemons. It's a common pattern to ditch permissions and then fork(), as per the old "Linux Daemon Writing HOWTO".
You can vfork()+exec(), why not? Exec too expensive? You can prefork[0].
Do people really do that? It sounds like a huge DOS vulnerability to me.