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: strerror_r() between fork and exec?


Hello, as you can see in the manual (at
http://www.gnu.org/software/libc/manual/html_mono/libc.html#index-strerror_005fr)
strerror_r is not safe in such a situation. The usual trick in such a
situation is to use a pipe to report back the error code to the
parent. If you really cannot use such a trick then one hack you might
be able to do is to fork an initial zygote process from before you
start using multithreaded functions and then spawn off forks of that
process instead of your latest one. These are just a few potential
approaches though and I would need to more about your particular
situation before I could give you better help.

Thank you,
Steven Stewart-Gallus


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