VTU Previous Year Question Papers BE CS Unix and Shell Programming December 2011

VTU Previous Year Question Papers BE CS Sixth Semester

Unix and Shell Programming December 2011

                                                            PART-A                                                                                

1  a. Bringout the major differences between ANSIC and K and R C. Explain each with example.

b Write a C/ C++ program that prints the POSDC defined configuration options supported on any given system using feature test macros.

c. Write a C /C++ program to check following limits :

i) Clock ticks

ii) Maximum number of child process

iii) Maximum path length

iv) Maximum file name

v)  Maximum number of files can be opened.

 

2 a. Explain the different file types available in UNIX or POSIX. Also write the commands to create all the files.

b. What are inodes in UNIX system? Differentiate between hard link and symbolic link.

c.  With a neat diagram, explain the UNIX Kernel support for files.

d- Explain the following APIs, with prototype :

i)    umask

ii)    stat

iii)    fstat

iv)  chown

v)    link.

 

3      a. Write a C or C++ program to illustrate the use of fcntl API for file locking.

b.  Explain the file APIs : READ, WRITE and OPEN, with prototypes and arguments.

c.   Write a C or C++ program to emulate UNIX Us-i command.

 

4  a. With a neat diagram, explain how a C – program is initialed and various ways it can be terminated.

b.   Write a Cor C++ program to illustrate use of setjmp and longjmp functions.

c.   Describe the UNIX Kernel support for a process. Show the related data structure.

d.  Explain in detail, the memory layout of aC- program.

PART – B

5   a. List and explain the family of exec functions with their prototypes. How do they differ from each other? Also give one program example using any one of the exec functions.

b.  What is a race condition? Write the program for generating race condition and to avoid the race condition.

c.   What is a job control? With a neat diagram, explain the job control features.

 

6 a. What are signals? Explain the prototype of sigation function. Also write a C or C++ program to setup signal handler using sigaction function.

b.  What is a signalmask of a process? Write a program to demonstrate use of sigprocmask function. Also write the prototype of all functions that are used to manipulate the signal sets.

c.   What are daemons? Explain the coding rules of the daemon process. Write a C or C++ program to initialize the uses defined daemon process.

 

7  a. What are pipes? Write a C or C++ program to create pipe from the parent to the child and send the data down the pipe.

b.  What are FIFOs? With a neat diagram, explain the client-server communication using FIFOs.

c.   What are message queues? Write the structure of the message queue and explain each member, in detail.

 

8 a. What are sockets? Explain the sequence of calling socket APIs for both server and client process. Briefly explain the prototype of each socket API.

b.  Write short notes on :

i)  Controlling terminal

ii)  Sigsetjmp and siglongkmp

iii)  Interpreter files

iv) Out -of-band data.

Leave a Comment