system and popen fail in case of big application
Martin Buchholz
martinrb@google.com
Wed Sep 12 19:46:00 GMT 2018
On Wed, Sep 12, 2018 at 9:29 AM, Zack Weinberg <zackw@panix.com> wrote:
> I don't want to encourage people to use posix_spawn because
> posix_spawn is a badly designed API. It's difficult to use correctly.
> It's *tedious* to use correctly, which means people won't bother. It
> can't do everything you might want to do on the child side (witness
> the discussion of adding an extension to let it do chdir()). Its
> behavior in case of errors is underspecified. And it might be
> implemented in terms of fork, which means it doesn't guarantee to
> solve Sergey's problem.
I seem to be in agreement with Zack's eloquent post. From java's
point of view, we need to avoid the momentary doubling of memory
caused by fork()ing a huge process, and we need to be able to specify
a working directory for the child. One strategy is to use posix_spawn
to start a small helper process which then in turn execs the real
child after necessary set up (including chdir).
More information about the Libc-alpha
mailing list