Question

In: Computer Science

When a process executes a "sleep" system call, from the perspective of the process, it simply...

  1. When a process executes a "sleep" system call, from the perspective of the process, it simply pauses for a specified amount of time and then resumes where it left off. Describe, in detail, what a sleep system call looks like from the perspective of the operating system.
  2. Regarding system calls:
    1. What is a system call?
    2. For each of the following system calls, give a condition that would cause it to fail: 1) open; 2) fork; and 3) exec.

Solutions

Expert Solution

The sleep system call consists of specified number of seconds , It's syntax is as given below :

 unsigned int sleep(unsigned int seconds);

When a sleep() call is encountered the thread which is called sleeps for the given number of seconds or it is interrupted by another signal . The return value of the sleep() is zero or the remaining number of seconds on interruption of it by another signal.

a) The interaction between a process and operating system is done by using a system call . The users can obtain services from the operating system using a system call .

b) 1) The open() system call can cause failure if the file mentioned is not available .

2) When fork() fails a negative integer is returned , if there is no enough memory on kernel to perform the task fork() fails

3) If there are errors specified for library functions exec() will fail , for example for error [E2BIG] the system call execve() will fail


Related Solutions

describe the in autonomic system activity that occurs when you are startled from your sleep
describe the in autonomic system activity that occurs when you are startled from your sleep
1)The Restorative (restoration) perspective of sleep believes that a)We sleep to eliminate build up toxins in...
1)The Restorative (restoration) perspective of sleep believes that a)We sleep to eliminate build up toxins in the brain b)Sleep is a result of lack of stimulation c)sleep is used to refresh and heal our bodies after expending energy d)Sleep is instinctive 2)Narcolepsy is a)A chronic problem with obtaining a sufficient amount of sleep b)An abrupt awakening from NREM sleep c)A sudden and irresistible onset of sleep during waking hours d)When the muscles engage in sleep movements 3)Freud said displacement was...
How is the kill() system call different from all other system calls?
How is the kill() system call different from all other system calls?
The following program calls the fork() system call to create a child process. Suppose that the...
The following program calls the fork() system call to create a child process. Suppose that the actual pids of the parent process and child process are as follows: Parent process: 801 Child process:   802 (as returned by fork) Assume all supporting libraries have been included. => Use the answer text field to write the values of the pids printed at lines 1, 2, 3, and 4 (indicate each line number and the value printed). int main() {      pid_t pid,...
2. Comment on the health of the existing banking system from the perspective of the following:...
2. Comment on the health of the existing banking system from the perspective of the following: a. an investor in a large bank like Citigroup, b. a depositor at a small local savings bank, and c. as a US taxpayer.
A 0.05 kg block executes damped oscillation when it is attached to a spring with a...
A 0.05 kg block executes damped oscillation when it is attached to a spring with a spring constant of 5 N/m. The damping constant for the medium is 0.1 N-s/m. At t=0, the block is displaced to 10 cm and it’s velocity is zero. Set up a differential equation corresponding to its motion. From the general solution for x(t) for this oscillator, do you think it is an underdamped, overdamped, or critically damped case? Justify your answer.
As a process executes, it changes states. Explain what are ready state, running state, and waiting...
As a process executes, it changes states. Explain what are ready state, running state, and waiting state. Also, describe when a process moves between these three states
Discuss the idea of parametric models from a system level perspective and proceed to develop a...
Discuss the idea of parametric models from a system level perspective and proceed to develop a 2-port model for the small-signal diode experiment using h-parameters. Explain what gets abstracted with this model. Are there any restrictions using this particular model?
Discuss the value of a specific electronic surveillance system of your choice from the perspective of...
Discuss the value of a specific electronic surveillance system of your choice from the perspective of real-time data surveillance and interoperability with the NIHS for reporting. How do you think John Snow would have appreciated a geographical (geospatial) information system (GIS) in the 1854 cholera outbreak in London?
You will provide a summary of the respiratory system from the perspective of inhaled air. Your...
You will provide a summary of the respiratory system from the perspective of inhaled air. Your description should include: - An organized progression of travel. What organs does the air travel through? What types of tissues and structures are seen within them? What purposes do those structures serve? - Orientation of those organs within the body using correct directional and regional terminology. For example - it is not adequate to say that air is inhaled via the nose, you should...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT