Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp577333lqp; Thu, 21 Mar 2024 09:17:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcfDKRVD/c6r8+eihestMbfTyEd9DOhvndepeWddtWLAJI88K/nrxJm561qP2xhHOgIXgmSJWopUjKGdoT4YrmCmUOW+s+tyxqr2GSWQ== X-Google-Smtp-Source: AGHT+IF7g0FY94RKtegiEUTaMmkqEF2c96cQWl8+7ggoX3MBK0TuAqD/tB5NGkK/kG5tCxGsrjTc X-Received: by 2002:a17:90a:3481:b0:29d:d93a:d6e7 with SMTP id p1-20020a17090a348100b0029dd93ad6e7mr9732530pjb.26.1711037819587; Thu, 21 Mar 2024 09:16:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711037819; cv=pass; d=google.com; s=arc-20160816; b=MYY0KYYyf6io1C6kQsgphweiywdRP4ibBD4VzvYABuHz0b13izg7d836BeCl4SST9g 7ielha5FHtcIU+Y83An0uNRE3yEiF4nfixOYTeTT71Oyb90NY7cPGa/vHOV/mU7kOhZY e1A10J4c1m6b1N6Y7okgH79uLohBsS5HwRQkA8r72DbMyhsBn0sRnjQnV7fGwC+98odT aBhSr+m9sOaG9mz3shnB4etqiuWZpvk34k+LnMw9CFlLaq11/c34Tf56EazjC83sxyKD dF7Mk24g8Y++kHDg5V07A0zRRX9xTsFm5BnFmTRO6/s4VT9CrMoGmzkhl4fpkVXDwneK Cauw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qoE+817QeGyk6SR6gb6WGEnhKQxz0b5uHMQ/FFL4NeM=; fh=S8ndmkQQ1uyeusdAmdSqPQWMH7RPt40uhf2+WuQCO7Q=; b=IaQhj0APlK1L2AkCLH4aSd9CQzEnMEPonwRqhPf5EFTK8nInB1ZejwbH9V3LH7P0Of WDIbyOcKamZSiYgThpPqw5VSjmtHdKMXmoJFAfoauQJ0rJsjkzAo1FVeRecj+3CnBCzZ RLOCJamnJBqxAXWQ0+vAKDJCHWXL8Uokxtet6zNCYK5vobyO6JTbO0iyWuIgBMaJX6Ze whfYKXkv6noFIWUXa2QnVkw/z/ReTEpb3Rxh2tKQuHTvtofo6kL+NtoUc8+W5shLMvaU PJF4s36eJhcjAMNbmKbuPvMl4Ol0bHZ7112ENWt5PAoL3Y6xQQc8WpvE8cGKUCO2K8CI X+SA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="OXXwi/WB"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w10-20020a17090abc0a00b002a011ad6329si2641607pjr.29.2024.03.21.09.16.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:16:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="OXXwi/WB"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110324-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3137D281A28 for ; Thu, 21 Mar 2024 16:16:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 665F312C53F; Thu, 21 Mar 2024 16:16:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OXXwi/WB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86E2412C529; Thu, 21 Mar 2024 16:16:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711037809; cv=none; b=X0XeDhMKb/E7zzKBe90S9XKbfN2p6Ztp+Z3t7pBqb5D91LGoq1+1Uie+8CEHqYofeDHbb2arRohrEWWkX38QwRaoKYuuJUyHcUhLZ39iqkuMZsAd/KI92syz07sHJMGj9jsxxblnVprrvXN5HJE0r336w11WKuXYavpmEGtXWNE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711037809; c=relaxed/simple; bh=j8WX7qh9sNSJEWTBsEjY35UwYY6dcP+XPto7bX2itzU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GO8W8EMp1xzWgJMoj3k2D1pMvDu8R9cAsHXzniO14LVseG2vIMD+hUtH+Xem4g2i/AuOP9cNXQ1m4RnOTaylicxJi20QE8M2uUrUxB1AP1jXTpmiKrh4yzqMzn2mQjY1cFyu7gOFENDGdFM0z3dOQ7sFw0UQxNezNH+fpvRJ+2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OXXwi/WB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5940EC433C7; Thu, 21 Mar 2024 16:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711037808; bh=j8WX7qh9sNSJEWTBsEjY35UwYY6dcP+XPto7bX2itzU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OXXwi/WBHhevMiC3fy622w4L6FLDA5BZuv85JQ7ar434vFbXaqJxxOsp9mE2Ufhcj DOXWtOb54JqxHgWmmfcxu1VUwtllkYB0kykceCBJcCnWgK4kvuzw6Pt2Q6ZCh1FI25 YPVtPjefV31clls19v9GgOzKgKh9aE5oJtMP+dw1J01SVoYwDoW69wy4vDKWv4+HgE trFc4iZcrbwamW41bDzke04+XcnyIzYhE+8uw6ZKg3WQPbEwawN5/BWX7FzJD9ImEa hx7YzHYvjZcFCxrvTvpOm9I29U9CLkRcKPFpoi8K8Chd/sLzKSlDG5EKTXM10VGC8T k5SrgKGqSLIiw== Date: Thu, 21 Mar 2024 13:16:45 -0300 From: Arnaldo Carvalho de Melo To: Andrii Nakryiko Cc: Andrii Nakryiko , Daniel Borkmann , bpf@vger.kernel.org, Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: Re: [PATCH 1/1] libbpf: Define MFD_CLOEXEC if not available Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Mar 21, 2024 at 09:13:35AM -0700, Andrii Nakryiko wrote: > On Thu, Mar 21, 2024 at 9:02 AM Arnaldo Carvalho de Melo > wrote: > > > > Since its going directly to the syscall to avoid not having > > memfd_create() available in some systems, do the same for its > > MFD_CLOEXEC flags, defining it if not available. > > > > This fixes the build in those systems, noticed while building perf on a > > set of build containers. > > > > Fixes: 9fa5e1a180aa639f ("libbpf: Call memfd_create() syscall directly") > > Cc: Andrii Nakryiko > > Cc: Daniel Borkmann > > Signed-off-by: Arnaldo Carvalho de Melo > > --- > > tools/lib/bpf/libbpf.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c > > index efab29b8935bd9f7..635a38c6f947a34d 100644 > > --- a/tools/lib/bpf/libbpf.c > > +++ b/tools/lib/bpf/libbpf.c > > @@ -1650,6 +1650,10 @@ static int sys_memfd_create(const char *name, unsigned flags) > > return syscall(__NR_memfd_create, name, flags); > > } > > > > +#ifndef MFD_CLOEXEC > > +#define MFD_CLOEXEC 0x0001U > > +#endif > > + > > makes sense, and lgtm. Do you need it in the bpf or bpf-next tree the > most? your patch header doesn't specify this Modern distros don't have this problem, so its not urgent, if bpf-next is more convenient for you, so be it. - Arnaldo > > > static int create_placeholder_fd(void) > > { > > int fd; > > -- > > 2.44.0 > >