210-250 · Question #31
Which definition of a fork in Linux is true?
The correct answer is D. new process created by a parent process. In Linux, fork() is the system call that creates a new child process as a duplicate of the calling parent process.
Question
Which definition of a fork in Linux is true?
Options
- Adaemon to execute scheduled commands
- Bparent directory name of a file pathname
- Cmacros for manipulating CPU sets
- Dnew process created by a parent process
How the community answered
(37 responses)- A3% (1)
- B3% (1)
- D95% (35)
Why each option
In Linux, fork() is the system call that creates a new child process as a duplicate of the calling parent process.
A daemon that executes scheduled commands describes crond, the cron daemon, which is an entirely separate process and concept from fork().
Returning the parent directory name of a file pathname describes the dirname command or the POSIX dirname() function, not fork().
Macros for manipulating CPU sets refers to CPU_SET and related macros defined in <sched.h>, which are used for CPU affinity and are unrelated to process creation.
The fork() system call in Linux creates a new process by duplicating the calling process, where the new process is called the child and the originating process is the parent. The child process receives a copy of the parent's memory space, file descriptors, and execution context, and the two processes then run concurrently. fork() returns 0 to the child and the child's PID to the parent, allowing each to determine its own role.
Concept tested: Linux fork() system call and process creation
Source: https://man7.org/linux/man-pages/man2/fork.2.html
Topics
Community Discussion
No community discussion yet for this question.