Back to Browse

OSL Practical 2A: Operating system practical| fork() | wait() | execve()| unix system call practical

1.2K views
Oct 17, 2025
16:50

In this video, we implement a C program that demonstrates process creation using fork(), synchronization using wait(), and the concepts of Zombie and Orphan processes with a simple sorting example. Both the Parent and Child processes perform sorting independently β€” the program clearly prints messages to show when a process becomes a Zombie and when it becomes an Orphan. πŸ’‘ Note: πŸ‘‰ I am running this program in WSL (Windows Subsystem for Linux), so I have added direct messages in the code output to indicate when the process is in a Zombie or Orphan state. πŸ‘‰ If you are using a full Linux environment, you can run the command below in another terminal to actually view these process states using : ps -l Look for status Z β†’ Zombie Process After parent exits, check PPID = 1 β†’ Orphan Process βš™οΈ Program Overview: The main program accepts an array of integers. A child process is created using fork(). The child performs sorting and exits β€” temporarily becoming a Zombie until the parent collects it using wait(). The parent process waits, sorts again, and demonstrates Orphan process creation using another fork(). Clear on-screen messages guide you through each process state. Concepts Covered: fork() and wait() system calls in C Parent and Child process creation Process states in OS (Running, Zombie, Orphan) Sorting demonstration (for logic clarity) Process IDs (PID, PPID) Linux process management #operatingsystem #operatingsystemlectures #operating_system #operatingsystemvideos #operatingSystemPractical #sppu #sppuexam #sppuupdate #sppuudate

Download

0 formats

No download links available.

OSL Practical 2A: Operating system practical| fork() | wait() | execve()| unix system call practical | NatokHD