From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16054 invoked by alias); 12 Sep 2018 19:46:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 15885 invoked by uid 89); 12 Sep 2018 19:45:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.9 required=5.0 tests=BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.2 spammy=weinberg X-HELO: mail-yw1-f53.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zX4WeXlkwSVboSLFZDy3dqTO9aUAKpbIF3FniBaKcvg=; b=K+mGODKS5JibyUs2DlzcgG0jkig/PZnuZSNM0n47mUZ/1IVtAD9WqU+/HwB/eQhFBL /VAoLz5wGCHA0OjwMPFanu1Go6LLgzIUqmt8sICVxqJmiB8BoMymzrQpyR0djl7wNq+O fOo/SBovLcvhSRjZCh5r283fXC7yHwi/V9bQ695xZ2K9di6CXPIIDqO6cri87959ITXw BCet0QyEmqV2c8jgJKN+ELGQB3Li08wD/hJLZTkygkzNlQFEmc8IY2JbiDF2vCMHHMsm VSKYGfJDW+bvxYgcy5JGjYOIMlw2HLRRxXclIHHVlINuthBvIWEKqZrERUNZE7SZuuO/ oAMw== MIME-Version: 1.0 In-Reply-To: References: <0caab9ea-5c2c-fe37-385b-090b21dd3cbb@linaro.org> From: Martin Buchholz Date: Wed, 12 Sep 2018 19:46:00 -0000 Message-ID: Subject: Re: system and popen fail in case of big application To: Zack Weinberg Cc: adhemerval.zanella@linaro.org, GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-09/txt/msg00168.txt.bz2 On Wed, Sep 12, 2018 at 9:29 AM, Zack Weinberg 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).