This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Robust getpid caching via MADV_WIPEONFORK?


On 11/22/2017 09:34 PM, Josh Triplett wrote:
Given that, I wanted to start a thread about the idea of making
getpid() caching, and for that matter other potential uses of
pthread_atfork(), robust using MADV_WIPEONFORK when available.

One major issue with the existing PID cache was the interaction with vfork, for calling abort/assert from the subprocess. MADV_WIPEONFORK mappings are not cleared on vfork, so such a PID cache would still return the wrong value in this context.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]