Created
September 7, 2025 09:55
-
-
Save jacobsapps/4a92f38037f329fdc64ec15e4b5a3baf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while (true) { | |
| char* command = read_input(); | |
| pid_t pid = fork(); | |
| if (pid == 0) { | |
| exec(command); // execute child process | |
| } else { | |
| wait(pid); // parent waits for child to finish | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment