AMIETE – CS/IT (NEW SCHEME)   -   Code: AC71/AT71

 

Subject: UNIX SYSTEMS PROGRAMS

Flowchart: Alternate Process: JUNE 2010
 


Time: 3 Hours                                                                                                     Max. Marks: 100

 

NOTE: There are 9 Questions in all.

·      Question 1 is compulsory and carries 20 marks. Answer to Q.1 must be written in the space provided for it in the answer book supplied and nowhere else.

·      Out of the remaining EIGHT Questions, answer any FIVE Questions. Each question carries 16 marks.

·      Any required data not explicitly given, may be suitably assumed and stated.

 

 

Q.1       Choose the correct or the best alternative in the following:                                  (210)

       

a.  The only two characters that can not appear in a file name are:                    

 

     (A) the slash character (/) and the null character    

            (B) the slash character (/) and the hyphen character(#).

            (C) the hyphen character(#) and the null character                                                           

                  (D) None of the above.                       

 

             b. ________ is indirect pointer to a file, unlike _____ which points directly to         i-node of the file.   

 

                  (A) Hard link, Symbolic link                  (B) Hard link, Index link

                  (C) Symbolic link, Hard link                  (D) Symbolic link, Index link

 

             c.  _________ is a technique used to notify a process that some condition has occurred.

 

                  (A) message                                         (B) email

                  (C) Signal                                             (D) None of the above

 

             d.  _______________ is the amount of time the process takes to run, and its value depends on the number of other processes being run on the system.

 

                  (A) Clock time                                     (B) User CPU time                                                            

                  (C) System CPU time                           (D) None of the above

 

             e.  The Shells process their command lines_______

                                           

                  (A) from right to left                              (B) from left to right

                  (C) any of the above                             (D) None of the above

 

    f. ____________ normally runs in background from a shell, and its standard input and standard output are connected to another program using a pipe.

 

                  (A) Processes                                       (B) Shared processes

                  (C) Multi-processes                              (D) Co-processes

             g.  Canonical mode input processing and non-canonical mode input processing is a feature of ___________. 

  

(A)  Signal                                             (B) Daemon processes                                                      

(C) Terminal I/O                                   (D) Interprocess communication

 

             h.  When we write data to a file, the data is normally copied by the kernel into one of its buffers and queued for writing to disk at some later time. This technique is ___________

            

                  (A) delayed write                                  (B) write                                                                           

                  (C) later write                                       (D) postponed write

 

             i.   ________ is used in shell start-up file to control shell’s action.

                      

                  (A) Process variables                            (B)  Environment variables                                                 

                  (C) Memory variables                           (D)  System variables

       

             j.   The ____________ function is the catchall for I/O operations.

 

                  (A) fsync                                              (B) fcntl

                  (C) ioctl                                                (D) fdatasync

                 

 

Answer any FIVE Questions out of EIGHT Questions.

Each question carries 16 marks.

 

 

  Q.2     a.   Draw the architecture of UNIX operating system.  Explain the functionality of each component.                                                                   (8)

                                                                             

             b.   Write a C program to get data from standard input and implement the following:-

                   (i)  Display data in standard output.

                   (ii) Save data in a file.                                                                                         (8)

                                                                                                                                                

  Q.3     a.   Mention any five types of files used in UNIX system.                                           (5)

                                                                             

             b.   Explain the following functions:

                   (i)   chown

                   (ii)  fchown

                   (iii) lchown                                                                                                         (6)

 

             c.   Explain file access permissions.                                                                           (5)

                                                                                                                                   

Q.4       a.   The following code works correctly on some machines, but not on others. What could be the problem?                                                                 (4)

                   #include <stdio.h>

                   int main (void)

                   {

                                 char c;

                                 while ((c = getchar()) != EOF)

                                         putchar (c);

                   }                  

       

             b.   Explain buffering techniques in standard I/O library.                                            (6)

 

             c.   Explain various fields of password file.  Where are shadow passwords used?          

                                                                                                                                             (6)

                  

  Q.5     a.   Describe the similarities and disimilarities between vfork and fork functions.           

                                                                                                                                             (6)

                  

             b.   Explain how race conditions occur in process control. How can it be avoided?

                                                                                                                                            (5)

 

             c.   Explain various functions that set user IDs for the following:-

                   (i)    Real user ID

                   (ii)   Effective user ID

                   (iii)  Saved set-user ID                                                                                       (5)
                                                                                                                             

  Q.6     a.   Mention three ways for a process to terminate:-

                   (i)    Normally

                   (ii)   Abnormally                                                                                                 (6)

 

             b.   Draw the flow chart of job control features with foreground jobs, background jobs and terminal driver.                                                                  (6)

 

             c.   Explain the features of orphaned process groups.                                                (4)

                  

  Q.7     a.   Mention any four conditions to generate a signal.                                                 (4)          

             b.   Write a C program to illustrate sigset jmp and siglongjmp functions.                     (8)

 

             c.   Explain reentrant function.                                                                                  (4)

            

  Q.8     a.    Define daemon processes.  Mention coding rules for daemon processes.             (8)

 

             b.   Write a program that prints the current window size and goes to sleep. Each time the window size changes, SIGWINCH is caught and the new size is printed.  The program has to be terminated with a signal.                                                           (8)

                                                                                                                                                

  Q.9     a.   What are the limitations of pipes? Mention the rules when one end of pipe is closed.                       (6)

                  

             b.   What happens if a malicious process reads a message from a message queue that is being used by a server and several clients? What information does the malicious process need to know to read the message queue?                                                           (4)

 

             c.   Explain the following:

                   (i)   Semaphores.

                   (ii)  Shared memory.                                                                                          (6)