You are on page 1of 1

1) Write a program to print the PID and the PPID of the current process.

2) Write a program to run the 'ls' command using the system call

3) Write an Example program to demonstrate fork() and execl() and system calls.

4) Write a program to spawn a child process running a new executable using execvp. It should returns
the process id of
the spawned process.

5) Write a program in which the Parent process creates a child and prints its pid. The Child modifies a
variable 'x' but the change should not be visible in parent's code. Given an array with 5 elements, the
Parent should also compute the products of these elements, while the child computes the sums of these
elements.

6) Write a program to create a zombie process.

7) Write a program to spawn a child process running a new executable using execle. It should set a
env variable and echo it

You might also like