From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C7DC21F47C for ; Wed, 11 Jan 2023 21:35:34 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=nT1iX4Qh; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 42AD23858C66 for ; Wed, 11 Jan 2023 21:35:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42AD23858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673472934; bh=1oFbCz9TuzSgRQCsuBpx1BK2prSy5qHnuCEfmcmG6tU=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=nT1iX4QhAbV+++P0FI5NqMYHHo9tuPuU7a8CJkiyrqO4mQ30l7qitkNdna6KlBfDV 9wRg4Z2/d7xvv+rBwNLoKsetcEiK8Xn4MMpzflRC3nKy1Yx3NPdePk70NmbiGkCOZ5 TXJ2GMjAHbhvmcQKUbndF0p5bacKbm1baSo/EMks= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D66563858C83 for ; Wed, 11 Jan 2023 21:35:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D66563858C83 Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-78-FdujH6tBM1GrJlcTD5qJPQ-1; Wed, 11 Jan 2023 16:35:12 -0500 X-MC-Unique: FdujH6tBM1GrJlcTD5qJPQ-1 Received: by mail-il1-f200.google.com with SMTP id e9-20020a056e020b2900b003036757d5caso11909205ilu.10 for ; Wed, 11 Jan 2023 13:35:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1oFbCz9TuzSgRQCsuBpx1BK2prSy5qHnuCEfmcmG6tU=; b=06DjwBFTJrBYP37VuYGHAfqo17uZ6K4dKKpgfP5ce3tx2xHuX6ZMGs3g9gXwQ7cs2V IXLL/7MO206yBZiAkvMBoHosUtBu+5C6AvRvVnCVVzWKZdK1gcVGX4J5lb7Mq/YXxTLO VjPgc3rlpGgUJVbCUlmtd8AR0Hb1hp9Gy5u42WJjJem2V/R05+ulTr+ZknAlGKazOv23 fVPX64/ccKhWB4qq2aMwLHEbSp9WWyhu6yivT2r1TMw+8kN6YfUF/nY/3fcZtQesnqrJ lzSXzjiWYFan4Yi3edxBDHoLlpxMYFenMn3Yi6RXOUiDaLScV+xykPhU1+LbgBljxmB7 XOTg== X-Gm-Message-State: AFqh2kpgoDJ5f4RY43FEGgTPngvacO6uVzcdPM+ow1VvVzYOp0oPY6Zo CykkDtJY64e3C2rqvuCfE7NRBSllWjRgu0tbzaZL2tMjfoMaftGB+ClTG6h/nLi1PlyTxj3QVMG H1uu6w8lOd01k3J2G2X7r X-Received: by 2002:a05:6602:10a:b0:6bc:d714:5202 with SMTP id s10-20020a056602010a00b006bcd7145202mr49114599iot.2.1673472911635; Wed, 11 Jan 2023 13:35:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXtlUhwjPTNd+QpWRZPvzXD3hZD2MLkcsRQRdvZJR2an1oIe9edMF25mz3C0qxXHYNy5+79rgA== X-Received: by 2002:a05:6602:10a:b0:6bc:d714:5202 with SMTP id s10-20020a056602010a00b006bcd7145202mr49114587iot.2.1673472911405; Wed, 11 Jan 2023 13:35:11 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id j5-20020a5d93c5000000b006bba42f7822sm5248874ioo.52.2023.01.11.13.35.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 13:35:10 -0800 (PST) Message-ID: Date: Wed, 11 Jan 2023 16:35:09 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v2 02/11] linux: Extend internal clone3 documentation To: Adhemerval Zanella , libc-alpha@sourceware.org, Szabolcs Nagy , "H . J . Lu" Cc: Christian Brauner References: <20221104190112.2566409-1-adhemerval.zanella@linaro.org> <20221104190112.2566409-3-adhemerval.zanella@linaro.org> Organization: Red Hat In-Reply-To: <20221104190112.2566409-3-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 11/4/22 15:01, Adhemerval Zanella via Libc-alpha wrote: > Different than kernel, clone3 returns EINVAL for NULL struct > clone_args or function pointer. This is similar to clone > interface that return EINVAL for NULL function argument. Please post v4. Suggest: Document that the internal __clone3 returns EINVAL for a NULL struct clone_args or function pointer and that this differs from the kernel. This behavior is similar to the clone interface that returns EINVAL for a NULL function argument. > It also clean up the Linux clone3.h interface, since it not > currently exported. Suggest: Additionally cleanup the Linux clone3.h interface (not currently exported). > > Checked on x86_64-linux-gnu. > --- > include/clone_internal.h | 24 +++++++++++++++++++----- > sysdeps/unix/sysv/linux/clone3.h | 10 +--------- > 2 files changed, 20 insertions(+), 14 deletions(-) > > diff --git a/include/clone_internal.h b/include/clone_internal.h > index 4b23ef33ce..73b8114df4 100644 > --- a/include/clone_internal.h > +++ b/include/clone_internal.h > @@ -1,10 +1,24 @@ > -#ifndef _CLONE3_H > -#include_next > +#ifndef _CLONE_INTERNAL_H > +#define _CLONE_INTERNAL_H > > -extern __typeof (clone3) __clone3; > +#include > > -/* The internal wrapper of clone/clone2 and clone3. If __clone3 returns > - -1 with ENOSYS, fall back to clone or clone2. */ > +/* The clone3 syscall provides a superset of the functionality of the clone > + interface. The kernel might extend __CL_ARGS struct in the future, with > + each version with a diffent __SIZE. If the child is created, it will > + start __FUNC function with __ARG arguments. OK. > + > + Different than kernel, the implementation also returns EINVAL for an > + invalid NULL __CL_ARGS or __FUNC (similar to __clone). Suggest: Unlike the kernel the implementation returns EINVAL for an invalid NULL __CL_ARGS or __FUNC (similar to __clone). > + This has nothing to do with the ABI in glibc so I'd avoid "ABI" here. Suggest: This function is only implemented if the machine defines HAVE_CLONE3_WRAPPER. > + This function is only implemented if the ABI defines HAVE_CLONE3_WRAPPER. > +*/ > +extern int __clone3 (struct clone_args *__cl_args, size_t __size, > + int (*__func) (void *__arg), void *__arg); > + > +/* The internal wrapper of clone/clone2 and clone3. Different than __clone3, > + it will align the stack if required. If __clone3 returns -1 with ENOSYS, > + fall back to clone or clone2. */ > extern int __clone_internal (struct clone_args *__cl_args, > int (*__func) (void *__arg), void *__arg); > > diff --git a/sysdeps/unix/sysv/linux/clone3.h b/sysdeps/unix/sysv/linux/clone3.h > index 889014a6a9..7c7e2cdcb0 100644 > --- a/sysdeps/unix/sysv/linux/clone3.h > +++ b/sysdeps/unix/sysv/linux/clone3.h > @@ -1,4 +1,4 @@ > -/* The wrapper of clone3. > +/* The clone3 kernel interface definitions. > Copyright (C) 2021-2022 Free Software Foundation, Inc. > This file is part of the GNU C Library. > > @@ -23,8 +23,6 @@ > #include > #include > > -__BEGIN_DECLS > - > /* The unsigned 64-bit and 8-byte aligned integer type. */ > typedef __U64_TYPE __aligned_uint64_t __attribute__ ((__aligned__ (8))); > > @@ -58,10 +56,4 @@ struct clone_args > __aligned_uint64_t cgroup; > }; > > -/* The wrapper of clone3. */ > -extern int clone3 (struct clone_args *__cl_args, size_t __size, > - int (*__func) (void *__arg), void *__arg); > - > -__END_DECLS > - OK. > #endif /* clone3.h */ -- Cheers, Carlos.