Question

Explain the different between the system function calls fork () and exec () ?

Explain the different between the system function calls fork () and exec () ?

Homework Answers

Answer #1

The fork() function is used to create a duplicate of the current process. When it duplicates the process, it creates a new process which almost identical, resource limit at some implementation, to the original process. The original process is known as parent process with associated PID and the newly created duplicate process is known as a child process with its own PID and it also holds the id of its parent process PPID.

The exec() function is used to replace the entire current process with a new one. It loads the new process in the memory space of current process and runs from the beginning.

For example, let's see a bash shell using ls command:-

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
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,...
topoisomerase has what function? _______ A) elongation of DNA at a replication fork by adding nucleotides...
topoisomerase has what function? _______ A) elongation of DNA at a replication fork by adding nucleotides to the existing chain B) unwinding of the double helix C) relieving strain in the DNA ahead of the rep fork D) stabilizing single stranded DNA at the Rep.fork E) addition of methyl groups to bases of DNA Explain why C is correct and why the other choices are incorrect as well as mention the names of the enzymes for the indicated function
As we know, the system() function calls /bin/sh, which is a symbolic link to /bin/bash. Recent...
As we know, the system() function calls /bin/sh, which is a symbolic link to /bin/bash. Recent versions of bash will drop the privilege if it detects that the effective user ID and the real user ID are different. Assume that we still want to use system() in our Return-tolibc attack, please describe how you can overcome this challenge. You are allowed to have zeros in your input (assume that memcpy() is used for memory copy, instead of strcpy())
(a) Give the syntax of fork() system call including return values on success and failure. (b)...
(a) Give the syntax of fork() system call including return values on success and failure. (b) Write a complete C-function void creatree(int n); that create a process tree with main process at level 0 and all children at level 1. You can use pause() system call if needed.
Linux 1. Describe the relationship between user mode and kernel mode during a system call? Explain...
Linux 1. Describe the relationship between user mode and kernel mode during a system call? Explain in detail. 2. In system calls for file input/output, why is buffering needed? Explain in detail.
Briefly explain how Linux SECCOMP may be used to prevent RoP attacks that use system calls.
Briefly explain how Linux SECCOMP may be used to prevent RoP attacks that use system calls.
explain the relation between reliability function and cumulative density function
explain the relation between reliability function and cumulative density function
Explain the difference between adaptive and maladaptive humor. Explain the relationship between sense of humor and...
Explain the difference between adaptive and maladaptive humor. Explain the relationship between sense of humor and immune system function. Explain the concept of emotional diversity.
A police department released the numbers of calls for the different days of the week during...
A police department released the numbers of calls for the different days of the week during the month of​October, as shown in the table to the right. Use a 0.010.01 significance level to test the claim that the different days of the week have the same frequencies of police calls. What is the fundamental error with this​ analysis? Day nbspDay Sun Mon Tues Wed Thurs Fri Sat FrequencyFrequency 153153 208208 226226 245245 179179 209209 234234 Determine the null and alternative...
Explain the differences between trading Naked call and puts and Covered calls and puts, why does...
Explain the differences between trading Naked call and puts and Covered calls and puts, why does this matter and what differences does it mean in margin management and risk management? Be specific and detailed.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT