From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 17261385800A for ; Mon, 1 Nov 2021 12:06:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17261385800A Received: by mail-pj1-x102b.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so15878144pjl.2 for ; Mon, 01 Nov 2021 05:06:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0RR7jbKH/FeVnmEvL0AIXxAb2EVpy+J4klbpFM8r8jI=; b=loC3qrZTwKgd0rp2yn9Eeh5/dRe9Tr9Ck0e1XruBeWL8dMh//01yT1YMTVgloPdvkT mh7cDL7AvUZSM75rapW+cZ/V4Dxu+ReIRvU10n6CK/D1aA4E1EKnrsQmtpmLfZvlicpw QFYtP9cra5wHxda166LZsxN00ZGVJAEyNX7D/KRVwASMcslGoTUZPI2j5/iB3G+Cm33R kU2V9SK0FBI1Fk7eMAqtclxYmVx3l3YgjIQROO5jW23ecaN/yBGYrT8rzHF4EscGu8b1 knFMUaCPP/AS+1oepkXRcKgft7QbfqPBbA2a+l/6YDr0/2JpR+7aN2u+kw66pQ+PRby/ xHIg== X-Gm-Message-State: AOAM532LpsceWglYwicRJMfKUz6kEPzWzkxFKtgJ6zp0uYGlZHwX6dqC ErG/j5gvfR3JT8PjN4nyHnhW9EIJMfMluaizCAA= X-Google-Smtp-Source: ABdhPJw6ciwdRBULKS9PplpC+pFj3p9jNdzgJkAKzQbV1xI8JHZXoJbesUutidnv0UWnQntUW/lyIE2rPQWmIsIHr7o= X-Received: by 2002:a17:903:2306:b0:141:e52e:457d with SMTP id d6-20020a170903230600b00141e52e457dmr6372149plh.3.1635768390135; Mon, 01 Nov 2021 05:06:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: zatrazz Date: Mon, 1 Nov 2021 09:06:19 -0300 Message-ID: Subject: Re: [Bug 214871] New: Man(3) system outdated To: "Alejandro Colomar (man-pages)" Cc: Libc-alpha , bugzilla-daemon@bugzilla.kernel.org X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FREEMAIL_REPLY, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2021 12:06:33 -0000 On Sat, Oct 30, 2021 at 8:55 AM Alejandro Colomar (man-pages) < alx.manpages@gmail.com> wrote: > [CC += Glibc, Adhemerval] > > Hi Adhemerval, > > On 10/29/21 22:37, bugzilla-daemon@bugzilla.kernel.org wrote: > > https://bugzilla.kernel.org/show_bug.cgi?id=214871 > > > > Bug ID: 214871 > > Summary: Man(3) system outdated > > Product: Documentation > > Version: unspecified > > Hardware: All > > OS: Linux > > Status: NEW > > Severity: normal > > Priority: P1 > > Component: man-pages > > Assignee: documentation_man-pages@kernel-bugs.osdl.org > > Reporter: mikekearney85@hotmail.com > > Regression: No > > > > During my recent university work, I have noticed the man (3) page for > system > > (https://man7.org/linux/man-pages/man3/system.3.html) states: > > > > The system() library function uses fork(2) to create a child process that > > executes the shell command specified in command using execl(3) as > follows: > > execl("/bin/sh", "sh", "-c", command, (char *) NULL); > > > > On reading the source code for system, this caused me some confusion. > > Eventually I found a commit from 2018 > > ( > https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=5fb7fc96350575c9adb1316833e48ca11553be49 > ), > > in which fork and exec were replaced by posix_spawn. The explains why I > could > > not aline the man page with the source code. > > > > I was about to change that line to say that it works "as if" using > fork(2) and execl(3), as POSIX says, but then, reading the page further, > it talks about many implementation details that seem to relate to when > glibc did actually use fork(2). They may be outdated now, so I think > it's better if someone from glibc that knows its current details reviews > the full page and proposes changes. > Hi Alejandro, Indeed we changed glibc to use posix_spawn on system and popen on 2.29 since to use posix_spawn (which uses clone (CLONE_VFORK | CLONE_VM)). It plays way better with Linux memory subsystem than fork() + exec() specially when such calls are used with process with large RSS. -- "Tradition is not the worship of ashes, but the preservation of fire." - Gustav Mahler