Fine tune discussion of getpid() caching bug.

The error by getpid() in the presence of clone() occurs
only for a fork-like clone (one that omits CLONE_VM from the flags.)
This is a low-level detail, but there is no problem [known-to-me]
for thread-like clone().
This commit is contained in:
John Reiser 2008-09-23 06:55:29 +02:00 committed by Michael Kerrisk
parent c60237c9b5
commit a1d48abb60
1 changed files with 5 additions and 1 deletions

View File

@ -729,7 +729,11 @@ when
.I should
return the same value in the child and in the process that called
.BR clone (),
since the caller and the child are in the same thread group.)
since the caller and the child are in the same thread group.
The problem stale-cache problem also does not occur if the
.I flags
argument includes
.BR CLONE_VM .)
To get the truth, it may be necessary to use code such as the following:
.nf