in Operating System
775 views
1 vote
1 vote
MSQ

 

Consider the following statements, which one of the following is/are TRUE

  1. In fork() system call, child process inherits all the open file descriptors of parent process
  2. In fork() system call,  child process copies the code of the parent process 
  3. In fork() system call,  child process shares the code of the parent process 
  4. User level threads shares the code segment of the process
in Operating System
775 views

3 Comments

Except (3), all of them are true.
4
4

2,3,4 this options are ans as threads doesn't share open file descriptor locks.

Refer this :

https://man7.org/linux/man-pages/man2/fork.2.html

0
0

the child inherits copies of the parent's set of open file descriptors. each file descriptor in the child refers to the same open file description as the corresponding file descriptor in the parent. this means that the two file descriptors share open file status flags, file offset, and signal-driven i/o attributes.

So Option 1,2,4 is correct.

https://man7.org/linux/man-pages/man2/fork.2.html

2
2

Please log in or register to answer this question.

Related questions