From: Li Wang via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] openat2: Move includes to lapi, remove _GNU_SOURCE
Date: Thu, 5 Feb 2026 14:08:42 +0800 [thread overview]
Message-ID: <aYQz6gN7WvJbSg1k@redhat.com> (raw)
In-Reply-To: <20260204124323.244578-1-pvorel@suse.cz>
On Wed, Feb 04, 2026 at 01:43:23PM +0100, Petr Vorel wrote:
> Improve 767b3e519e. struct open_how is also used in lapi/openat2.h,
> which is used by all openat2*.c tests. Therefore move <fcntl.h> to the
> lapi header (and use lapi/fcntl.h instead).
>
> Also remove _GNU_SOURCE which should not be needed.
>
> While at it, move include "config.h" to the top.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi Li,
>
> my points from the original patchset why not use _GNU_SOURCE:
>
> glibc test tst-openat2.c [1] which includes <fcntl.h>, uses struct
Interesting, I haven't figure out why it can be built within glibc itself.
> open_how and test openat2() does not define it. Neither openat2() nor
> struct open_how [2] are guarded by #ifdef __USE_GNU.
>
> O_DIRECTORY is guarded by #ifdef __USE_XOPEN2K8 but this should be safe as we
> compile with -std=gnu99.
In glibc-2.43, things have changed, only define __USE_GNU can contain the
<bits/openat2.h> header file, that's why after applying this patch still
fails to complie on Fedora-Rawhide.
<fcntl.h> -> <bits/fcntl.h> -> <bits/fcntl-linux.h> -> <bits/openat2.h>
# cat bits/fcntl-linux.h
396 #ifdef __USE_GNU
...
473 #include <bits/openat2.h>
489 #endif /* use GNU */
See: https://github.com/bminor/glibc/commit/0f0a5cd338998f4b603f52f3ce2163df0db7b814#diff-a4fc1e1b56b60a2598e320a232e6f631d08e0dafcfe3dd9607dde4bc8ee31eb8R473
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-02-05 6:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 12:43 [LTP] [PATCH] openat2: Move includes to lapi, remove _GNU_SOURCE Petr Vorel
2026-02-05 6:08 ` Li Wang via ltp [this message]
2026-02-05 9:41 ` Li Wang via ltp
2026-02-05 10:25 ` Petr Vorel
2026-02-05 9:44 ` Petr Vorel
2026-02-05 10:17 ` Li Wang via ltp
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=aYQz6gN7WvJbSg1k@redhat.com \
--to=ltp@lists.linux.it \
--cc=liwang@redhat.com \
--cc=pvorel@suse.cz \
/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