mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Networking <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] libbpf: ensure F_DUPFD_CLOEXEC is defined
Date: Fri, 4 Mar 2022 22:54:54 +0100	[thread overview]
Message-ID: <c2d6db56-0381-d72c-2c9d-1e0ea324ceff@iogearbox.net> (raw)
In-Reply-To: <CAEf4Bza84V1hwknb9XR+cNz8Sy4BK2EMYB-Oudq==pOYpqV0nw@mail.gmail.com>

On 3/4/22 8:01 PM, Andrii Nakryiko wrote:
> On Mon, Feb 28, 2022 at 7:00 AM Daniel Borkmann <daniel@iogearbox.net> 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 <james.hilliard1@gmail.com>
>>
>> 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 <linux/fcntl.h> 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

  reply	other threads:[~2022-03-04 21:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 14:25 James Hilliard
2022-02-28 15:00 ` Daniel Borkmann
2022-03-04 19:01   ` Andrii Nakryiko
2022-03-04 21:54     ` Daniel Borkmann [this message]
2022-03-05  9:57     ` James Hilliard
2022-03-05  9:54   ` James Hilliard
2022-03-08  1:35     ` Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2d6db56-0381-d72c-2c9d-1e0ea324ceff@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®