Sei sulla pagina 1di 2

US

Department of Computer Science and Engineering

Acharya Institute of Technology


INTERNAL ASSESMENT TEST 2 [Academic Year (Even Semester): 2014-2015]

Semester: 6th B
Max Marks: 50

Date: 09-04-2015
Time: 3:00 PM - 4:30 PM

Sub with Code: UNIX SYSTEM PROGRAMMING (10CS62)


Note: Answer ALL questions. Each question carries 10 Marks.
Qn.N
o.
1

Question

Explain environment structure of process. Mention any SIX environment


variables.
(OR)
2
Consider the last 100 bytes as a region. implement using C/C++ program
to check whether the region is locked or not. If the region is locked, print pid
of the process which has locked. If the region is not locked, lock the region
with an exclusive lock, read the last 50 bytes and unlock the region.
32. With related data structure, explain the kernel support for a process.
(OR)
4
Demonstrate using C/C++, how to establish interprocess communication
between a reader process and a writer process. Use mkfifo, open, read,
write and close APIs in your program.
What are the different ways of terminating the process? Explain atexit
5
function with programming example.
(OR)
6
Design a c/c++ programs to emulate mv and ln command in unix.
7
With example, explain setenv, getenv, putevn functions. How memory
allocation and deallocation plays a role in these functions.
(OR)
8 Illustrate using C/C++ program how to create the file in directory
/home/progs. Also read the contents of file into array and write characters
from keyboard to file.
9 With neat diagram, explain memory layout of a C program. For the
following given C program, identify the various segments when the
program is executed:
#include<stdio.h>
int a=5;
int b; int data[10]; const int i=5;
int main( ) {
int X; char *ptr=malloc(50);
return 0; }
(OR)

Course
Outco
me
CO-3

CO-3
CO-3

CO-3
CO-3
CO-3
CO-3
CO-3

CO-3

Department of Computer Science and Engineering, Acharya Institute of Technology Bangalore

US
N

10

Construct C/C++ program to create symbolic and hard link in the specified
path using APIs.

CO-3

****************** All the Best *******************

Department of Computer Science and Engineering, Acharya Institute of Technology Bangalore

Potrebbero piacerti anche