fork() system call do in process creation?The fork() system call creates a new process by duplicating the calling process. The new process is called the child process, and it is almost an exact copy of the parent process.
exec() family of functions?The exec() functions replace the current process's memory and code with a new program. This means the process starts running a different program without creating a new process.
fork() and exec() work together in creating a new process?First, fork() creates a copy of the current process. Then, the child process uses exec() to replace its code with a new program. This way, a new process runs a different program.
fork() call?After fork(), both processes run independently. The parent gets the child's process ID as the return value, while the child gets zero. They have separate memory spaces but start as copies.
fork() considered a cheap operation in modern operating systems?Because modern OS use 'copy-on-write', which means the actual copying of memory happens only if either process changes it. This saves time and memory when creating new processes.
fork() system call return to the child process?The fork() call returns 0 to the child process and the child's process ID to the parent.
exec() replaces the current process's code and memory with a new program.
fork() fails?If fork() fails, it returns -1 indicating an error.
fork()?Copy-on-write delays copying memory until either process modifies it, saving resources.
fork()?After fork(), the child runs the same program as the parent until it calls exec() or exits.
fork() and exec() work together to create a new process running a different program.fork() is called and why copy-on-write is important.