From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id C178C38515E8 for ; Mon, 5 Apr 2021 11:31:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C178C38515E8 Received: by mail-ej1-x631.google.com with SMTP id r12so16387785ejr.5 for ; Mon, 05 Apr 2021 04:31:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Kx8XHdP4JA2sPGCJpiQHbqV41GO+I+mr8LnnbSHhEnk=; b=fONjw6fUFjiCMqeJ0mAl0c7b43Uq2PpaoQtMdlYm9ev42IKKUxrxYRdAYwRzetY4is MxWDKMvIBWvi46TyPlh2V89nJemQWCSPP4/a2rhvIXxMzA+RMQHqVamsf+hznrAfR/6h zLfWwL/xmCK3rjlHppRBRD3l0SA/VM5Z4aRdl93fWhziyhQ9eOzvqtsUGyMhqW8WJx11 FW30YalvHyN2TxQcmuH+CYH3OrrzjWx/lBcX9ZffVcBejvzXMfKhw39sRWr33usBk769 4tJhy/LmqESPq/d1YYmTI5xgEMwkXpt/FbfN7Qg34CDwnmPhAfClvn5niQLc3jlJ2TYA R42g== X-Gm-Message-State: AOAM533Xa5JNyRvJlD507dp7tUOPENUW2238laiNY1ZpWpqDWA7OGcTm bvafRm3G8Dn1NDeIcJGyC/RaYOoUJSE= X-Google-Smtp-Source: ABdhPJwyag+QRdUoEQC0l2A0IoAxmiXrrKwyymgneTFJ/SM8AzBTERTFNrSeWGdbf9tpo/JNI3FvnA== X-Received: by 2002:a17:907:8315:: with SMTP id mq21mr14734143ejc.197.1617622286692; Mon, 05 Apr 2021 04:31:26 -0700 (PDT) Received: from ?IPv6:2001:a61:2553:a401:cfc6:2039:a9ec:21ff? ([2001:a61:2553:a401:cfc6:2039:a9ec:21ff]) by smtp.gmail.com with ESMTPSA id h13sm10924084edz.71.2021.04.05.04.31.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Apr 2021 04:31:26 -0700 (PDT) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH v5 11/35] clone.2: Use syscall(SYS_...); for system calls without a wrapper To: Alejandro Colomar References: <20210403194026.102818-1-alx.manpages@gmail.com> <20210404115847.78166-12-alx.manpages@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Mon, 5 Apr 2021 13:31:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210404115847.78166-12-alx.manpages@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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, 05 Apr 2021 11:31:30 -0000 Hi Alex, On 4/4/21 1:58 PM, Alejandro Colomar wrote: > The CLONE_* constants seem to be available from either > or , and since clone3() already > includes for 'struct clone_args', > is not really needed, AFAICS; however, to avoid confussion, > I also included for clone3() for consistency: I think that's a good decision. > clone() is getting CLONE_* from , and it would confuse > the reader if clone3() got the same CLONE_* constants from a > different header. Agreed. Patch applied. Thanks, Michael > > Signed-off-by: Alejandro Colomar > --- > man2/clone.2 | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/man2/clone.2 b/man2/clone.2 > index fa7d1103e..f455c97d8 100644 > --- a/man2/clone.2 > +++ b/man2/clone.2 > @@ -56,13 +56,13 @@ clone, __clone2, clone3 \- create a child process > .PP > /* For the prototype of the raw clone() system call, see NOTES */ > .PP > -.BI "long clone3(struct clone_args *" cl_args ", size_t " size ); > -.fi > +.BR "#include " " /* Definition of " "struct clone_args" " */" > +.BR "#include " " /* Definition of " CLONE_* " constants */" > +.BR "#include " " /* Definition of " SYS_* " constants */" > +.B #include > .PP > -.IR Note : > -There is no glibc wrapper for > -.BR clone3 (); > -see NOTES. > +.BI "long syscall(SYS_clone3, struct clone_args *" cl_args ", size_t " size ); > +.fi > .SH DESCRIPTION > These system calls > create a new ("child") process, in a manner similar to > @@ -1541,11 +1541,6 @@ One use of these systems calls > is to implement threads: multiple flows of control in a program that > run concurrently in a shared address space. > .PP > -Glibc does not provide a wrapper for > -.BR clone3 (); > -call it using > -.BR syscall (2). > -.PP > Note that the glibc > .BR clone () > wrapper function makes some changes > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/