> -----Original Message----- > From: Matthew Dempsky <matt...@dempsky.org> > Sent: Friday, January 3, 2020 2:27 AM > To: Schwarz, Konrad (CT RDA IOT SES-DE) <konrad.schw...@siemens.com> > Cc: Karstens, Nate <nate.karst...@garmin.com>; austin-group-l@opengroup.org > Subject: Re: system() and pthread_atfork() > > On Thu, Jan 2, 2020 at 5:01 AM Schwarz, Konrad > <mailto:konrad.schw...@siemens.com> wrote: > > I think the right solution is for POSIX to require system() and popen() to > > call pthread_atfork() handlers. > > How would this work for systems where system() is implemented using > posix_spawn()? posix_spawn()'s RATIONALE > explicitly mentions that it can be used to implement system(), but also it's > meant to be implementable without > using fork() (and thus without fork handlers). > > It seems like the requirement should be more nuanced. E.g., that *if* > system() is implemented using fork(), then it must call at-fork handlers. I'm > not sure how to phrase that in > standardese though.
In my “second attempt”, I wrote > I think the right solution is for POSIX to require system() and popen() to > call pthread_atfork() handlers, if they [i.e., system() and popen()] are not > atomic with regards to exec().