When is a finally{} block executed?
Always after execution has left a try{} block, no matter for what reason.
Only when an unhandled exception is thrown in a try{} block.
Only when any exception is thrown in a try{} block.
Always just as a method is about to finish.
The correct set of sequence for file operations for a file say 'test'
lseek(), open(), write(), close()
open(), write(), lseek(), close()
open(), lseek(), open(), , write() close()
None
Difference between fork() & vfork()
vforlk() allows more one child process to be created simaltaneously whereas for() allows only one
vfork() retains same PID for child & parent known as virtual PID
vfork() suspends the parent process until child process exits
fork() & vfork() are same
How can I get/set an environment variable from a program?
getenv(), setenv()
getenv(), putenv()
readenv(), writeenv()
You cannot environmement variables inside a program
What does alarm() do
Wakes up kernel from sleeping
Wakes up devices from sleeping
Invokes a kernel to send SIGALARM to the calling process
Invokes a kernel to send SIGALARM to the registered process
What is a shared memory
A memeory shared between kernel & devices
A memory shared between root user and ordinary user
A memory shared across processes
Harddisk
What is a zombie interval?
The interval between child terminating and the parent calling wait()
The interval between parent terminating and the child calling popen()
The interval between parent terminating and the child termination
Why do processes never decrease in size?
They never releases the memory utilized
They release the memory but kernel does not use them
Since they are running
It’s a false statement
How can I find out if someone else has a file open?
Its not possible
use isused() function
Try to open file with locking enabled
Try to write the file after opening
How do I `lock' a file?
Use filelock()
use lockfile()
Use lockfd()
use fcntl()