CENG 328 OPERATING SYSTEM LAB WORK 4


Using argc and argv as command line arguments

main.c

Process management

processes.c Why do we have “End fork test.” twice.

processes1.c PARENT: My parent's PID is 1576. Find out the parent of PARENT by using “ps u” command.

processes2.c Describe the function of sleep(10); system call.

processes3.c Describe the function of wait(&status); system call.

procinterleave.c An example of command line arguments with fork() system call.

exec1.c The exec family of functions replaces the current process image with a new process image. Give the command “man exec” to investigate.

exec2.c execl is used as a child process.


Study the example we described in the class. fork.c


Invesigate the following program for creating 3 processes where first process is the parent of the second one and the second process is the parent of the third one. Study the followings;