mirror of https://github.com/mkerrisk/man-pages
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:
parent
c60237c9b5
commit
a1d48abb60
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue