In: Computer Science
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