From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 26D333858D28 for ; Wed, 18 Jan 2023 22:25:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 26D333858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674080732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rnrdb+818HuVbDw/3ryMo8Gj+sCWmW1wB9WyswjVfyE=; b=Ixm3y3xLOZBB2LU73xigELCUE7NMG3DKYrMrZTLTEdeaw9mmBtiWnIZFSEMFwoFXRcBEuD YZi25ZK8eRkR8btECY501cM3ODls3UtKI/VnLfuHwn4wabUfD0nGvUWPpId508OrkjYo4F y+AoaQNcZEB/buTN8Cl8HGSMYh+cwwI= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-39-VJYMlZMmNaGQJFj_C3nOSA-1; Wed, 18 Jan 2023 17:25:31 -0500 X-MC-Unique: VJYMlZMmNaGQJFj_C3nOSA-1 Received: by mail-io1-f72.google.com with SMTP id z19-20020a056602205300b0070756e30008so178261iod.15 for ; Wed, 18 Jan 2023 14:25:31 -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 :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=Rnrdb+818HuVbDw/3ryMo8Gj+sCWmW1wB9WyswjVfyE=; b=dHG23htM286siwz1Umj6UAgW+kqzkVHCaV8wL31cCsVVmHd2hIzxHbxJ5lmiUs1gQ6 2cG+nTE56nTnvdCnXdMF91+4JtHYNnTOZZHbRp/eAXAWd7X+3R7VLQ0u44xNpDqHt2Rr 41rr0FVlXR+i4K6JMuVJjteO3AvuwGEFn2YQwZFLKwWQOJfFSnjWT78HQOdlAMXfMt0q jljsuldmDng/AWhhYemHnf0rvu1jPwhbxBEEav40zSLScAzkAf00STvfMa87buNPVHkj IpSCw3xz5/zuQ05+b58IjFQxTOHSOU4NaBC2NinJxw62JuE1SsHKG9ZJ+Vm9gR3Ljl8K Nu4w== X-Gm-Message-State: AFqh2kqjj6JllIvgi0klDA/B3oDW/bdX6Wb9KwE0dQJ498t7eiRPgSUj slIi/6eIIBOTpTMcbx2+M8Q4fe/bd+ZWfa58WPYZBQBgRJAhtxcCPiyPBAR1ZuVD9dmsNxcXhcX XgTXsGk1uO2BHd7qEzxmY X-Received: by 2002:a92:ce86:0:b0:30e:f07b:3a07 with SMTP id r6-20020a92ce86000000b0030ef07b3a07mr5951700ilo.17.1674080730651; Wed, 18 Jan 2023 14:25:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXtuAgF/1ML3TXNebGntrNhDuak/CxpTLyYu5AIGp9EulCIXLeWmzY8wg4upYEsDVkcRmuzPOw== X-Received: by 2002:a92:ce86:0:b0:30e:f07b:3a07 with SMTP id r6-20020a92ce86000000b0030ef07b3a07mr5951689ilo.17.1674080730449; Wed, 18 Jan 2023 14:25:30 -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 k15-20020a02334f000000b0039d71c46577sm10041115jak.21.2023.01.18.14.25.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 14:25:30 -0800 (PST) Message-ID: Date: Wed, 18 Jan 2023 17:25:29 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v4 2/6] linux: Extend internal clone3 documentation To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20230112135853.3786675-1-adhemerval.zanella@linaro.org> <20230112135853.3786675-3-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20230112135853.3786675-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-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/12/23 08:58, Adhemerval Zanella 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. > > It also clean up the Linux clone3.h interface, since it not > currently exported. > > Checked on x86_64-linux-gnu. OK for 2.28. Reviewed-by: Carlos O'Donell > --- > 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. > + > + Different than kernel, the implementation also returns EINVAL for an > + invalid NULL __CL_ARGS or __FUNC (similar to __clone). > + > + 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 42055ea981..e4d642e521 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-2023 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 > - > #endif /* clone3.h */ -- Cheers, Carlos.