Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which system call replaces a current process in Linux ?

  • A.pipe
  • B.fork
  • C.exec
  • D.dup

Answer: C

The system call is exec.

The exec family (execve and its wrappers such as execl and execvp) replaces the current process image with a new program: the code, data and stack are replaced, while the process ID stays the same. It does not return on success.

fork creates a new child process that is a copy of the caller, rather than replacing it; the usual pattern is fork followed by exec in the child. pipe creates a channel between processes, and dup duplicates a file descriptor.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.