You are on page 1of 8
t oe C861 — OBOE USN Sixth Semester B.E. Degree Examination, June/July 08 UNIX System Programming Time: 3 hrs. Max. Marks:100 Note: Answer any FIVE full questions. 1a. Explain POSIX feature test macros. (0 Marks) b. Explain UNIX kemel support for files with neat block diagram. (10 Marks) 2a, Explain following APJ’s with prototypes: i) Open i) Creat fii) Read iv) Write, (08 Marks) b. Bring out the differences between hardlink and symbolic link (06 Marks) ©. Describe FIFO and device file classes. (06 Marks) 3 a. Explain file and record locking. (08 Marks) b. Illustrate the usage of mkfifo and mknod system calls, (06 Marks) c. Explain five different ways of process termination (06 Marks) 4° a. Explain with an example the use of setimp and longjmp functions. (10 Marks) b. Explain fork and vfork system calls. When does fork system call fail? 0 Marks) 5 a. Explain different exec functions. Write a program in C to demonstrate the exec function. (10 Marks) b. Explain process accounting structure in UNIX with an example. (10 Marks) 6 2, Explain process groups and sessions. (08 Marks) b. Explain job control with an example. (08 Marks) ¢. Show the state of processes after login has been invoked. (04 Marks) 7a. Explain duemon characteristics and coding rules with an example. (10 Marks) b. Explain UNIX kernel support for handling different signals, (10 Marks) 8 a. Explain popen and pclose functions. (08 Marks) b. Explain message queue with a neat diagram. (06 Marks) ¢. Explain client-server communication using FIFO. (06 Marks) usw | Coo any" ena Sixth Semester B.E. Degree Examination, Dec. 07 / Jan. 08 Unix System Programming Time: 3 bre, Max. Marks:100 Note : Answer any FIVE full questions. Whatare:the major differences between ANSI C and K and R °C’? Explain with examples (08 Marks) List! att Teast four compile time limits along with their minimum values and explain their meaning. Write a ‘C’ program that displays the values of the above configuration limits using sysconf and pathconf functions. (08 Marks) ¢. Describe the characteristics of POSIX. | FIPS standard, (04 Marks) Explaity five different file types that are supported on UNIX along with the procedure to create-the-file of each type. (08 Marks) Explaim-thte UNIX kemel support files with a neat diagram. (03 Marks) Write-a program in C/C++ to emulate the UNIX In command. (04 Marks) ‘What is:file and record locking? Explain with fentl system call. Write a program in C/C++ to set'am exclusive lock on the entire file using fentl system eal. If fentl fails, find out who has locked the file and display all the lock information to the standard output. (10 Marks) Explaim the following API’s along with their prototype definitions i) open i) Iseck ') fStat (06 Marks) Write:aprogram in C/C++ to implement UNIX chown program (04 Marks) . Describe how a ‘C” program is started and how it is terminated with a neat block diagram and also demonstrate the use of atexit function by writing the program of exithandlers. (08 Marks) With a neat block diagram explain the UNIX kernel support for processes. (08 Marks) Explain the memory layout ofa ‘C” program with a neat diagram (04 Marks) What is fork and vfork? Explain with an example program for each. (06 Marks) How many processes are created by executing the following program excluding the parent process? int maingvoid) { for int i=0; 1<3; +4) fork() : return 0; 3 (02 Marks) What is a zombie process? What is the overhead associated with zombies? (04 Marks) Explain 6 different exec fimetions. Describe how their functionality differ from each other. Write a program in C/C++ that executes an interpreter file. (08 Marks) What i meant by job control? What support is required for job control, explain with an example. (10 Marks) What is a signal? Explain the different dispositions of a signal when it occurs. When do you say a signal is pending? Write a program in C/C++ that masks SIG-PIPE and SIG- ABORT signals, check if they are pending. If they are pending, unmask and service them. (10 Marks) What is a daemon process? Discuss the basic coding rules, along with the code to create a daemon process (0 Marks) What is ELFO? Explain how it is used in IPC (interprocess communication). Discuss with an example the client/server communication using PIFO’s, (10 Marks) Explain identifier, key and permission structure of IPC. (10 Marks) Explain popen and pclose finetions with their prototypes and a program in C/C++ to demonstrate the popen and pelose functions, (10 Marks) C861 o4e8 USN L] Sixth Semester B.E. Degree Examination, July 2007 cs/Is Unix System Programming Time: 3 hrs.] [Max. Marks:100 Note: Answer any FIVE full questions. 1a What is POSIX standard? Explain different subsets of POSIX standard, Write the structure of the program to filter out non — POSIX compliant codes from a user program. (08 Marks) b. Write a C/C++ POSIX compliant program that prints the POSIX defined configuration options supported on any given system using feature test macros. (08 Marks) ¢. What is an API? How it is different from the C library function? Why is calling an API is more time consuming than calling a user function? (04 Marks) 2 a. List and explain the access mode flags and access modifier flags used in open API. Also explain how the permission value specified in an36+ ‘open ¢ call is modified by its calling process “umask” value. (08 Marks) b. Describe the UNIX kernel support for files. (08 Marks) ©. Write the command to create a block device file called SCS15 with major and minor device numbers 15 and 3 respectively and access rights read ~ write — execute for everyone. (04 Marks) 3 a. Discuss how font! API is used for file and record locking. (08 Marks) b. Desoribe the UNIX kemel support for a process, Show the related data structures. (08 Marks) ©. Give the hierarchy structure of the file classes. (04 Marks) 4a. What is fork and vfork? Explain with an example program foreach. _ (08 Marks) b, What is race condition? Write a program in C/C++ to illustrate the race condition. (08 Marks) Write a C/C++ program that outputs the contents of its environment list. (04 Marks) 5 a. Explain the different exec functions. How does their functioning differ from each other? (10 Marks) b. What is Job control? Summarize the Job control features with the help of a figure. (10 Marks) 6 a. What is a Signal? Discuss any five POSIX defined signals. Explain how to setup a signal handler. (40 Marks) b. Discuss daemon characteristics and coding rules. (10 Marks) What is shared memory concept? How itis used for implementing IPC? (10 Marks) What are Pipes? Explain their limitations. Explain how pipes are created and used in IPC with an example, (10 Marks) 8 — Write short notes on any Four: a. Zombie process oP b. Inodes. ©. Network login 4d. Semaphores. e. Process group and sessions. 20 Marts) Page No... I C861 - O60F USN [ T [ ] W SCHEME Sixth Semester B.E. Degree Examination, July 2006 Unix Systems Programming Time: 3 hrs.] [Max. Marks:100 Note : Answer any Five full questions. 1a) What are the major differences between ANSI ‘C” and K & R°C’? Explain with examples. (10 Marks) b), Write a C/C++ POSIX complaint program that supported on any given system using feature test macros. (10 Marks) 2 a) Explain the different file types available in UNIX or POSIX systems. (08 Marks) b) Describe the UNIX kernel support for files. (08 Marks) ©) Write a program in C/C++ to emulate the UNIX In Command. (04 Marks) 3 a) Explain how fenti API is used for file and record locking, (08 Marks) b) With an example program, explain the use of setimp and longjmp functions. (08 Marks) ©) Write a C/C++ program that outputs the contents of its environment list, (04 Marks) 4. a) What is fork and vfork? Explain with an example program for each. (10 Marks) b) What is a Zombie process? Write a C/C++ program to avoid Zombie process by forking twice. (10 Marks) 5 a) How UNIX operating system keeps process accounting? (10 Marks) b) What is Job Control? Summarize the Job Control features with the help of a figure. (10 Marks) 6 a) What isa SIGNAL? Explain how to setup a signal handler? (10 Marks) b) What is a doemon? Discuss the basic coding rules, (10 Marks) 7 a) What is FIFO? Explain how it is used in IPC. Discuss with an example the client-server communication using FIFOS (10 Marks) +) What is shared memory concept? How it is used for implementing IPC? (10 Marks) 8 Write short notes on : a) Inodes, b) Race Condition, c) 4.3+BSD Network Login, d) Semaphores. __(4x5~20 Marks) Page No... 1 CS61 «¢ Reg. No. J Sixth Semester B.E. Degree Examination, January / February 2006 Computer Science and Engineering/Information Science & Engineering Unix Systems Programming Time: 3 hrs.) (Max.Marks : 100 Note: Answer any FIVE full questions. 1. (@) What is POSIX standard ? Explain different subsets of POSIX standard. Write the structure of the program to fiterout non-POSIX compliant codes from a user program. (6 Marks) y Write a C/O+* POSTX compliant program to check the following limits: Number of clock ticks il) Moximum number of child processes ii) Maximum path length ') Maximum characters in a fle name v) Maximum number of open files per process (@ Marks) (©) Explain the common characteristics of API and describe the error status codes. (6 Marks) 2. (a) Explain the different file types available in UNIX or POSIX systems. (@ Marks) (b) Describe the UNIX Kemel support for files. (6 Marks) (©) Write the code segment in C that reads utmost 100 bytes into a variable but from standard input. (4 Maries) 3. (@) Listand explain the access mode flags and access modifier flags. Also explain how the permission value specified in on ‘open’ call is modified by its caling process ‘umask’ value. 6 Marks) (b) Explain how fentl API can be used for file and record locking. (@ Morks) (©) Give the hierarchy structure of the file classes. (4 Marie) 4, (@) Whats fork and viork ? Explain with an example program foreach. —_¢@ Marks) (b) Describe the UNIX kernel support for a process. Show the related data structures, @ Marks) (©) Wille a program in C/C++ to obtain process attributes. (4 Marks) 5. (@) What is job control ? Summarize the job control fectures with the help of a figure. 10 Marks) (®) Explain the different exec functions ? Describe how thelr functioning differ from ‘each other. «10 Marks) 6. (a) What is a signal 7 Discuss any five POSIX - defined signals, Explain how fo setup a signal handier. (10 Marks) () What is a daemon ? Give its basic coding rules. (10 Marks) Ce a Conta, Agee” Poge No.. 2 “ S61 7. (@) What are pipes ? Explain thelr limitations. Explain how pipes are created and used in IPC with an example, (10 Marks) (b) Explain the UNIX kemel support for messages. Show the related data structures. (10 Marks) 8. write short notes on any FOUR. (@ Race condition (b) Zombie process (©) Network Login (a) Co process (©) Interval timers (8x4=20 Marks) wo K No... ee NEW SCHEME sted Time: v USN Sixth Semester B.E. Degree Examination, July/August 2005 Computer Science / Information Science and Engineering (Common to (CS/IS) Unix System Programming hrs [Max Marks : 100 Note: 7. Answer any FIVE full questions. 2. Programs can be written in C or c++ 3. Missing data must be appropriately assumed, (a) List out-all- POSIX.-1 and POSIX. th-defined “system configuration: timits” in manifested constants with compiletime limit, minimum value and meaning. (10 marks) (0) Explain unix Kernel suppor for files with neet data structure. (10 Marks) . (2) Differentiate between hard link and symbolic links with an example. (6 Marks) (0) Describe FIFO and device file classes (6 tars) (©) Differentiate between ANSI C and C++ standards 6 Marks) (@) Explain process of changing user and group ID of fle. (6 Marks) . (a) What are named pipes ? Explain with an example the use of Iseek, link, access, with their prototypes and argument values. (12 Marks) (0) Explain how fenti APt can be used for fle and record locking. (@ marks) (@) Explain 6 different exec functions, Describe how their functions difer from each other. White a program that execs an interpreter file, (10 Hark) {b) Explain how process accounting is done in UNIX system. Write a program to generate accounting data and give its process structure. (10 Alaks) .(@) What is meant by job control ? What support is required for job control ? Explain with example. (10 Marks) (0) What is a controling terminal ? Explain its characteristics and relation to session and process groups. (10 Marks) . (@) Explain with prototypes kil function, sigsetimp and siglongimp API's. (6 Marks) (b) Discuss daemon characteristics and coding rules. (6 Marks) (©) Write a program in ‘C’ to set up a real time clock intemal time using alarm API. (10 Marks) {@) Give an overview of IPC methods. (5 Maris) {b) Explain p open and p close functions with prototypes and write a program to demonstrate the p open and p close functions. (10 Marks) (c) What is the need for sigproc mask function ? (6 Maris) 3 cont. 24) Page No... 2 8. Write a short note on 2° a) Environment list b) Semaphores 9 cs61 Client server interaction ) Coprocesses : (45220 Marks)

You might also like