62.1k views
2 votes
If after a call to fork, we want any updates to memory by the parent process to be visible to the child process, and vice-versa, what flag should be included in the fourth argument of mmap?

User CalvinR
by
5.2k points

1 Answer

0 votes

Answer:

MAP_SHARED

Step-by-step explanation:

The MAP_SHARED should be included in the 4th argument of map. When we have a MAP_SHARED set, then we have it that it is preserved across a fork2 system call.

It is visible immediately in every parent, siblings or child processes. This is to say that any change that is made to this mapping is immediately seen by readers.

User Dale King
by
5.7k points