OSDN Git Service

Fix getpid caching across a clone.
authorElliott Hughes <enh@google.com>
Tue, 24 Jun 2014 00:49:45 +0000 (17:49 -0700)
committerElliott Hughes <enh@google.com>
Tue, 24 Jun 2014 00:49:45 +0000 (17:49 -0700)
commitfa9e16efaf0e885f6044e725eb759ef6de10f7ef
treeb2788038c17cde5a1d53c13a51d6a16868bd229f
parent0d7415fb225573c37ff9e880957cd2044dd658ce
Fix getpid caching across a clone.

If you make clone, fork, or vfork system calls directly, you're still
on your own, but we now do the right thing for the clone wrapper.
With this implementation, children lose the getpid caching, but we've
no reason to think that that covers any significant use cases.

Bug: 15387103
Change-Id: Icfab6b63c708fea830960742ec92aeba8ce7680d
libc/bionic/clone.cpp
tests/unistd_test.cpp