This is the mail archive of the libc-help@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: static fork strerror and how they interact.


On 03/16/2015 04:52 PM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>> On 10/29/2014 02:37 PM, Steven Stewart-Gallus wrote:
>>> You have to use strerror_r. If you fork from a mullithreaded process you can't
>>> allocate memory safely though. An ugly hack to solve the problem is to spawn a
>>
>> You must not call async-signal-unsafe functions, and malloc
>> et. al. are async-signal unsafe. Therefore you can't allocate
>> memory, you must use a static buffer.
> 
> We have to support malloc-after-fork as an extension, at the very
> least if the original program was not multi-threaded.  Too many
> programs rely on that.

If the original program was not multi-threaded then everything is
much simpler and the AS-safe conditions don't have to be imposed,
since you can't be *in* malloc and *in* fork at the same time.

Cheers,
Carlos.
 


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