Write a C program to create a Zombie process.
AIM :
Write a C program to create a Zombie process.
Program:
#include <stdlib.h> #include <sys/types.h> #include <unistd.h> int main () { int pid_t child_pid; child_pid = fork (); if (child_pid > 0) { sleep (60); } else { exit (0); } return 0; }
Output:
guest-glcbIs@ubuntu:~$gcc zombie.c guest-glcbIs@ubuntu:~$./a.out Then command prompt will wait for some time(60 sec) and then again command prompt will appear later.
-
UpdatedOct 23, 2014
-
Views15,961
You May Like
Write a Shell script to find factorial of a given integer.
Write in C the following Unix commands using system calls A). cat B). ls C). mv
Write a Shell script that displays list of all the files in the current directory to which the user has read, Write and execute permissions.
Write a Shell script that accepts a filename, starting and ending line numbers as arguments and displays all the lines between the given line numbers.
Write a C program to emulate the Unix ls-l command.
Write a Shell script to list all of the directory files in a directory.