PrepZone Logo
PrepZone
Back to Fundamentals

Fundamentals · Medium

What do fork(), exec(), and wait() do in Unix-like systems?

FresherFundamentalsOperating Systems

Answer preview

The classic UNIX pattern for spawning a new program: fork() creates a child copy, exec() replaces it with a new program, and wait() lets the parent collect the exit status.…