This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
static fork strerror and how they interact.
- From: "frank ernest" <doark at mail dot com>
- To: libc-help at sourceware dot org
- Date: Tue, 28 Oct 2014 14:01:31 +0100
- Subject: static fork strerror and how they interact.
- Authentication-results: sourceware.org; auth=none
- Sensitivity: Normal
Hello, I've been reading the glibc docs and they read that the function strerror warns that when using multiple threads that the static buffer may be overwritten. At the same time I wanted to create a new thread using fork and it says thet the process it spawns _will_ have a complete copy of the parents memory space. I also thought from what I learned that declaring anything as static garentees that the said thing will not be addressable from another process.
My question is this, if I'm correct in my deductions so far am I corretc in believing that the strerror function, after fork is used, _will_ have a _seperate_ static buffer for the newly spawned process, and so the buffer will not be accidentally overwritten?