Which of the following system calls does not return control to the calling point, on termination?Select one:a. execb. forkc. waitd. ioctl
Question
Which of the following system calls does not return control to the calling point, on termination?Select one:a. execb. forkc. waitd. ioctl
Solution
The correct answer is a. exec.
The exec system call replaces the current process image with a new process image. It does not return control to the calling point because the original calling process no longer exists after the exec system call has been made.
On the other hand, fork, wait, and ioctl are all system calls that do return control to the calling point.
-
fork creates a new process by duplicating the existing process. The new process (child) gets a different process ID and has its own copy of the parent's descriptors. Both processes continue to execute from the point right after the fork system call.
-
wait is used to make a parent process wait until one of its child processes exits. After the child process has finished execution, then the control is returned to the parent process from the wait system call.
-
ioctl stands for "input-output control". It provides a generic interface for device-specific operations. After performing the operation, control is returned to the calling point.
Similar Questions
estion: What is the purpose of the "fork" system call in Unix-like operating systems?A) To create a new processB) To terminate a processC) To wait f
Consider the following fragment of a program: ... int a=0; int main() { a = 1; int pid=fork(); if(pid == 0) { printf("%d\n", a); } else if(pid > 0) { printf("%d\n", a); } return 0; } When run, what output do you observe and what do you think is the reason for the observed output? You may assume that the call to fork() succeeds. Question 4 Select one: a. The parent process outputs 1, but the child process outputs 0, because the value of a is updated only in the parent process. b. Both the parent and the child processes output 1, because the child process inherits the memory state from the parent at the point where fork() is called, and the variable a has been assigned the value 1 at that point. c. The parent process outputs 0, but the child process outputs 1, because the value of a is updated only in the child process.
Which control statement is used to exit the current method and return a value?Question 2Answera.continueb.returnc.exitd.break
Which command wait for the specified process to complete and return the exit status?*1 pointa) sleepb) waitc) delayd) stop
if a thread in a program invokes exec() immediately after fork() . So-------Select one:a. duplicates only calling thread is appropriateb. duplicates all threads in a separate process
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.