Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp565527lqp; Thu, 21 Mar 2024 09:02:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWSP3OTrs8vODbln1IiNfwTh6Nzuh0XJo3i/PwbiqYMeoO/9pCl0TWF7JVWEeSXfnno6YbN8Jqyk4C9sMs6uySrye6zWv6CmGPGK6JA9A== X-Google-Smtp-Source: AGHT+IHX8/Szen/+A5Y55vHaknsTFaurn+E6YDIMrtj6qpYb3MVLAJYXC7BqLLYWqNL/64zbEMc5 X-Received: by 2002:a17:906:f9d8:b0:a46:bdd8:64ef with SMTP id lj24-20020a170906f9d800b00a46bdd864efmr1735948ejb.19.1711036947601; Thu, 21 Mar 2024 09:02:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711036947; cv=pass; d=google.com; s=arc-20160816; b=x3/TFZjvMtK9rECxGkf1FGPUcfgrCiuDbQo5jh8BgHffx0+11Yz9QyAb27D8mgqXtp ZkqDCFC3/trvSVGOA6bHpLmk2UfcG/Kpc1kEKtbTGjXJNgKCM9FBs7o6WZpXqhZGwefy 3NMGEx2i9xfsyAv/PLTN8LAj4wxnxrhmR7M/6eLgzdnYectZ1sUwo8dYWgLyb+H1LfdB F3WC3xxNVfUPOaKY1kDs/csxNhzb3ZpvM0WTyklgBbI/Rae9juyRxdwgR6ZwD0/IH3e9 ypS/Yf9Yer5Zz2OFlozwvrMhnNrYWAvAnv0CL86YnkEPgZOpucwhRPtM8IdG/OyZq3cW V2dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=/ikYvF+DWXrYrbNRjOUEA7Y6brMkADyzrBk4kvNQBkk=; fh=PS0gPDlR8ne0Vyo0mNnVTSdcwZ/G/Wlh7bVZhmfvATQ=; b=1B/dCSDLEnbXsNIqE8s8iELsCWCF/jpKmU009MWDDmHCDQydfdR2cnfsWnPwtnoEGp DXGMla+I2Wh2c1Fai06tXCAA5EZta0DSA220RWj5pF5DZZ6NFUfy43XZzl2P6NcdVew2 vWQ5s3Rr++hPgHJvwgjWIDnGV6NT1JR7QHb/DteM5eJXquVNvtOshKQ0waWF1vFAeMYf bobw8kw03lSdkHuXperOcuCxvKvpWVhYgJA4L/rLwV1gx7OC6P6Y8gWGjpp0DLqiwQJr VLcz75XoUhANWl+geWbLyISkdjCoRYZDrYJqCn8KAo3D4DwdOSGGyhTRzuYUla164ux/ 7W7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z5KcVdIb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110292-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110292-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s3-20020a170906bc4300b00a466a1f0812si56268ejv.177.2024.03.21.09.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:02:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110292-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z5KcVdIb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110292-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110292-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3C7651F21A5A for ; Thu, 21 Mar 2024 16:02:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 167FC12BF2E; Thu, 21 Mar 2024 16:02:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z5KcVdIb" 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 2D61E12BF1C; Thu, 21 Mar 2024 16:02:02 +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=1711036922; cv=none; b=T2L4+JV9863mdriwJX4D/o5AW8ocOciqnbEZvWTcIz5RDsf7/F5XISuUPp/XifLoJcLxLQugpCdYnzPLkNnl0DLNUSr4er8Xk6Xl7S8dZr4l8m0Bv8GcONmIJqzELSk6WQQwr8mCsyY6KbghKszImkr1knaLtiWh+HNfnNS5tz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711036922; c=relaxed/simple; bh=zw11YjpMl3FoiTr/2sFaVVMvcMLI7sst8F38+AzzMmg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=LTeX1UJ3J3VWC+SPLjEVz/2fMh8zs4Y/QPd0L4bFjhWKYTt8ZxQvecoMoBxCrr2UL+C3kSPXTjQPI78LJO/wyTK+zxYPcYItQ+TEoEiLSbIGA6fWcZJzEuwXH6U3zf1HENlK2hqpINiQYHWS4ztzgYGK+zziUdryBGUwZNzaugU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z5KcVdIb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85CDAC433C7; Thu, 21 Mar 2024 16:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711036922; bh=zw11YjpMl3FoiTr/2sFaVVMvcMLI7sst8F38+AzzMmg=; h=Date:From:To:Cc:Subject:From; b=Z5KcVdIb2aD4AR5R8XnG1HAFcm60tL4tdGJz7G0+V7OlqX8VdLVpnJMKkg8Qz5Sp5 agbUUp5mZfM/ngmwEIQY0/SqjeuVmtoT7hX9SqlygYgNTYRtwU9xRKLsQx6CNcFyOX r5djo+RCIO02U70rI4B2ILVI/n2TGUublGv2Eilm1D64aiOkOXfpNvS8EZmteKyuVA wI6RN8v61GWE3e59yk2VjOhDvfL+S8vPl5T0k7gR+8gCcWlHDJCydGn3NxhF9tsR/f Gx4C7KYyUC6AFE2dzdaWtAz5hb+LYnC9lX/MaujNVtIP56dVu1M+r4v5LSNiId2biC v10cXgp4svtZw== Date: Thu, 21 Mar 2024 13:01:58 -0300 From: Arnaldo Carvalho de Melo To: Andrii Nakryiko , Daniel Borkmann Cc: bpf@vger.kernel.org, Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Subject: [PATCH 1/1] libbpf: Define MFD_CLOEXEC if not available Message-ID: 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=us-ascii Content-Disposition: inline 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 + static int create_placeholder_fd(void) { int fd; -- 2.44.0