Answer the following questions.
Question 1) In algorithm iput for releasing in _core inode, consider:
i) reference count = 0 and link _count > 0
ii) reference count = 0 and link _count = 0
What would happen in each case?
Question 2) How does wait algorithm respond to the death of child signal?
Question 3) Explain the swap out function of a swapper process.
Question 4) What are block and character device switch tables? Which system call is used to create the device file?
Question 5) Explain the actions taken by kernel for detaching a region from a process.
Question 6) Write a program in C in which parent process will write into unnamed pipe and child will read from it.
Question 7) What does the following program demonstrate? Describe its working.
# include < signal.h >
main (int argc, char * argv [ ] ) ;
{
Char buf [256] ;
if (argc ! = 1)
signal (SIGCLD, SIGIGN)
While ( read (0, buf, 256))
if ( fork ( ) = = 0)
{
exit (0) ;
}
}
Question 8) Write a program in C to print inode number of every file of a directory. (Accept directory name from user.).