Sei sulla pagina 1di 4

CHAPTER 4 : Unix Process

1. Explain with a neat diagram how a C program starts and how it is terminated. 10
2. What are setjmp and longjmp functions? Explain with a program to transfer the control
access function using them. 10
3. Explain the following system calls 10
a) Longjump()
b) _exit()
c) atexit()
d) calloc()
e) unsetenv()
4. What are environment variables explain with all the system call that are used to handle
them.
5. What are getrlimit() and setrlimit() functions explain. Give the description for the
following RLIMIT_NPROC, RLIMIT_LOCKS, RLIMIT_MEMLOCK,
RLIMIT_NOFILE, RLIMIT_SBSIZE
6. What do u mean by dynamic memory allocation explain in detail all the functions used
for it.
7. Explain the typical memory layout of a C-program with a neat diagram
8. With an example program explain the use of setjump and longjump function
9. What are the different ways for a process to terminate? Explain exit, -exit, atexit
functions with its prototypes. (Jun/Jul 2011) [8M]
10. Explain the memory layout of a C program with a neat diagram.
(Jun/Jul 2011) [8M]
11. Explain getrlimit and setrlimit functions with prototype. Mention the three rules
to change the resource limits. Give four resource values. Jun/Jul 2011 [6M]
12. 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 exit handlers.
(CS61 Dec07/Jan08) [8M]
13. Write an explanatory note on environment variables. Also write a C/C++ prgm
that outputs the contents of its environment list. (Dec09/Jan10) [6M]
14. With an example prgm, explain the use of setjmp and long jmp functions.
(Dec09/Jan10) [8M]
15. Write a C/C++ prgm to demonstrate the use of atexit function.
(May/June 10) [10M]
16. What do you mean by command line argument? Explain with an example.
DEC 10 [3M]
17. Explain the following with an example: i) setjmp and longjmp ii) setrlimit and
getrlimit DEC10 [4M]
5 Marks
1. What are command line arguments? With example explain the cmd arguements
2. Give the prototypes of getrlimit and setrlimit functions and any five resource
limit types.
3. What is an environment variable? Explain any four of them
4. Give the prototype of all functions used in dynamic memory allocation n explain
5. Explain putenv(), setenv(), unsetenv() functions and there prototypes.

UNIT-2: Unix Files


1. What are API common characteristics? List any 5 values of global variable errno along
with their meanings whenever APIs fail. [jun-july 2011] [6marks]

2. List and explain the different types available in unix.


[jun-july 2011] [8marks] [Dec 09-jan 09] [10marks]

3.Describe the unix kernel support files with a neat diagram. [may-jun 2010][10marks]
[jun-july 2011] [6marks]
4.Explain the different types of file types available in UNIX or POSIX with the
commands that can be used to create the file types. [dec2010] [10marks]

5. Describe the unix kernel support files. Explain with a neat diagram, the data structure
it maintains for a file. [dec2010] [10marks]

6. What is an open API? List and explain the access mode floss and access modifier floss
used in an open API. Explain how the permission value specified in an open call is
modified by its calling umosk value. [May-jun 2010] [10marks]

8. Explain the different types of file types available in UNIX with the procedure to create
the file of each type. [dec2010] [10marks]

9. Write a program in C/C++ to emulate the UNIX ln command [dec2010]


[4marks] [july 2006] [4marks]
[dec 09-jan10] [4marks]
10. Differentiate between hard links and symbolic links with example. [jul-aug 05]
[5marks] [may-june 2010] [dec2010] [4marks]

12. Explain process of changing user and group ID of files. [jul-aug 05]
[5marks]

13. List and explain the access mode flags and access modifier flags used in API. Also
explain how the permission value specified in an 56+ open call is modified by its
calling process unmask value. [jul 2007] [8marks]

14. Write a 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. [jul 2007] [4marks]
15. Discuss with a neat diagram, the different data structures supported by unix Kernel
for its manipulation. [May-june 2010] [8marks]

16. List all the file attributes along with their meaning. Which of these attributes can be
changed and why? List the commands needed to change the following attributes
I) File size ii) User ID iii) Last access and modification time IV) Hard link count
[june-july 2010] [5 marks]

17. Write the code segment in C that reads atmost 100bytes into a variable but from
standard input. [jan-feb 06] [4 marks]

19. Explain with example the following APIs with its prototype
i) open ii) create iii) read iv) fontl. [dec 09-jan10] [8marks]

20. List atleast 8 system configuration limits, along with their minimum values and
meaning. Write a C++ program that is POSIX complain,to list the actual implemented
values of these limits. In which header file are these limits defined?
[jun-jul 2011] [10marks]

21. With neat clock schematic, discuss the kernel support for files in UNIX/ POSIX and
enlist the process that follows when a file is opened. Also discuss the sequence of
events that follows when close is called to close the file. [jun-jul 2011] [10marks]

UNIT-3 Unix File APIs


1) Explain the following APIs with prototypes:
i) Open ; ii) Lseek ; iii) Stat ; iv) Read. Jun/jul 2011 [8M]

2) Write a C++ program to implement following UNIX commands:


i) ln ii)mv jun/jul 2011 [8M]

3)Bring out the differences between hardlink and symbolic link. Jun/jul 2011
[4M]

4) List and explain the access mode flags and access modifier flags. Explain how
permission value specified in an open call is modified by its calling process unmask
value.Illustrate with an example. cs/is61 dec 2010 [10m]

5) Explain the following APIs with their prototype definitions and return values:
i) lseek ii) fstat iii) link iv) fenlt v) access cs/is61 dec 2010
[10m]

6) Explain how fentl API can be used for file and record locking. cs/is61 may/jun 2010
[10m]

8) Write the hierarchy structure of the file classes. CS/IS61 MAY/JUN 2010 [4M]

9) What is file and record locking? Explain with fentl system call. Write a program in
C/C++ to set an exclusive lock on the entire file using fentl system call. If fentl fails,
find out who has locked the file and display all the lock information to the standard
output. CS/61 DEC 07/JAN 08 [10M]

10) Explain the following APIs with prototypes definitions:


i) Open ; ii) Lseek ; iii) fstat CS/61 DEC 07/JAN 08 [6M]

11) Write a prgm in C/C++ to implement UNIX chown program. CS/61 DEC 07/JAN
08 [4M]

15) Describe the UNIX kernel support for a process. Show the related data structures.
CS61 JUL 07[8M]

16) What are symbolic link file APIs? Write a C/C++ program to emulate the UNIX Ln
command. MAY/JUN 2010 [8M]

17) With an example program, explain the use of setjump and longjump functions.
CS61 JULY 2006 [8M]

18) Write a C/C++ program that outputs the contents of its environment list.
CS61 JULY 2006 [4M]

19) List the structure used to query the file attributes in UNIX. Write a C++ prgm to list
the following file attributes if the given regular file passed as command line argument.
i) File type ii) Hard link count iii) File size iv) File name. v) user ID JUN/JUL
2009 [8M]

20) Describe the open API, clearly indicating its prototype declaration, the values the
arguments take along with their meaning. Give two instances, when open API can fail.
List all the access modifier flags and explain their meanings.
JUN/JUL 2009 [6M]

21) List the important uses of fentl API. Give its prototype descripyion. Write a C++
prgm to check whether the close-on-exec flag is set for a given file. If it is not set, use
fent to set this flag. Also show the implementation of dupz macro using this API.
JUN/JUL 2009 [6M]

22) What is the importance of locking files? What are the mandatory and advisory locks?
Why is advisory lock considered safe? What are the drawbacks of advisory lock?
Explain. DEC 2010 [7M]

23) Write a program to implement ls-l command. CS61 Dec08/Jan 09 [10M]

26) What are the different ways for a process to terminate? Explain exit, -exit and at exit
function with its prototypes. Dec09/Jan10 [8M]

27) Bring out the importance of files in UNIX. List the various types of files and the
commands/utilities to create them. What are inodes? Explain the important differences
b/w hard and soft links. Why is that hard links cant be created across the file systems?

CS61 JUN/JUL 2011


[10M]

Potrebbero piacerti anche