Received: by 2002:a19:6e46:0:0:0:0:0 with SMTP id q6csp393388lfk; Fri, 4 Mar 2022 14:41:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxzfk2wbbQcpelAeMBjrTHYCEMHEPCwCNWN1g1t22VgC5CIkwaJC7pcfBxZZfjGO/VQm7Nt X-Received: by 2002:a63:6c8a:0:b0:37c:62da:a647 with SMTP id h132-20020a636c8a000000b0037c62daa647mr461147pgc.423.1646433692525; Fri, 04 Mar 2022 14:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646433692; cv=none; d=google.com; s=arc-20160816; b=V1aiwqq6ENGw+7Irpe+0EU2n88sjrJ1Y4HuZzVKeoReHRWSli42MRK5HdOLGAhjT2B ggh91yIm1Kda4DGRBgVk6OwbDAOPuhne1UMwvxbwDt/6HyLNdQKtrhX8HWxgawfS54qy FKFX6H46Hj64jGeTETvVJZUinc5DPlhnC5fozwFo2z6pd0b2bsGvE0rlSH+vaNGazOAX Gn1FpK+tUK9NWMfdQHB0WdbH8HbtGhhBHibUxs6HaOUUsCCKQfgkJwo9RfnlbG6k+OP/ zRSPgoTS4CxdWPoSx6EB3ZjjM02EnBh39VvaWBqzRhy218TThK6vpr2wK7oKEAkMEJcO 6Ing== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=NEdSRUEUDDQOgveWWCn0lXKqt8jZLj1Y7uRNhXtO93o=; b=vbScxeCZg6CV7F4IKyZA3v5KGJhDQbJsk3rEKslWdGki2yK6ufX/gG6HJxJnBl9Nr3 xuu9lQv27rYpO14udeXm7X4uO+C3bC0Cojs7x0Ghl91TBgJkqJ295luP+vXu11Py68Cq u3jaaj/W/WucIzc9BeHjwkltuHPDp8I6SEd/TG2gKP8+ApsDIF/r1lq17CDATOC1ITkw Gmh2I+jYhRSwd/vfq4IoJFn5fqarx1thJ/l8AB5IJ/DIn5ztrH0S0TG7acOf0H+ei3rI asrObemPH9gmp42r/8qcI0bs08PoYXkmbN5WrYN7JFsRqh9GNWrPzrpnHRzf8esvz/fP 420g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a656bc8000000b00368e38afab4si5949626pgw.7.2022.03.04.14.40.52; Fri, 04 Mar 2022 14:41:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbiCDVz4 (ORCPT + 99 others); Fri, 4 Mar 2022 16:55:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbiCDVzz (ORCPT ); Fri, 4 Mar 2022 16:55:55 -0500 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B7426D579; Fri, 4 Mar 2022 13:54:58 -0800 (PST) Received: from sslproxy01.your-server.de ([78.46.139.224]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1nQFt1-000G6t-Qi; Fri, 04 Mar 2022 22:54:55 +0100 Received: from [85.1.206.226] (helo=linux.home) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nQFt1-000A9c-G3; Fri, 04 Mar 2022 22:54:55 +0100 Subject: Re: [PATCH 1/1] libbpf: ensure F_DUPFD_CLOEXEC is defined To: James Hilliard Cc: Andrii Nakryiko , bpf , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Networking , open list References: <20220227142551.2349805-1-james.hilliard1@gmail.com> <6af1530a-a4bf-dccf-947d-78ce235a4414@iogearbox.net> From: Daniel Borkmann Message-ID: Date: Fri, 4 Mar 2022 22:54:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.5/26471/Fri Mar 4 10:24:47 2022) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/4/22 8:01 PM, Andrii Nakryiko wrote: > On Mon, Feb 28, 2022 at 7:00 AM Daniel Borkmann wrote: >> On 2/27/22 3:25 PM, James Hilliard wrote: >>> This definition seems to be missing from some older toolchains. >>> >>> Note that the fcntl.h in libbpf_internal.h is not a kernel header >>> but rather a toolchain libc header. >>> >>> Fixes: >>> libbpf_internal.h:521:18: error: 'F_DUPFD_CLOEXEC' undeclared (first use in this function); did you mean 'FD_CLOEXEC'? >>> fd = fcntl(fd, F_DUPFD_CLOEXEC, 3); >>> ^~~~~~~~~~~~~~~ >>> FD_CLOEXEC >>> >>> Signed-off-by: James Hilliard >> >> Do you have some more info on your env (e.g. libc)? Looks like F_DUPFD_CLOEXEC >> was added back in 2.6.24 kernel. When did libc add it? > > It seems like it's guarded by __USE_XOPEN2K8 in glibc (from a quick > glance at glibc code). But it's been there since 2010 or so, at the > very least. > >> Should we instead just add an include for to libbpf_internal.h >> (given it defines F_DUPFD_CLOEXEC as well)? > > yep, this is UAPI header so we can use it easily (we'll need to sync > it into Github repo, but that's not a problem) Sgtm, James, could you respin with using the include? Thanks, Daniel