From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] openat2: Move includes to lapi, remove _GNU_SOURCE
Date: Thu, 5 Feb 2026 10:44:58 +0100 [thread overview]
Message-ID: <20260205094458.GA294817@pevik> (raw)
In-Reply-To: <aYQz6gN7WvJbSg1k@redhat.com>
> 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.
I also checked Makefile, but haven't found that. Never mind, I was wrong, it's
obviously needed.
> > 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>
Yeah, I saw this...
> # cat bits/fcntl-linux.h
> 396 #ifdef __USE_GNU
...but did not check that whole section is guarded by __USE_GNU (=> _GNU_SOURCE).
Kind regards,
Petr
> ...
> 473 #include <bits/openat2.h>
> 489 #endif /* use GNU */
> See: https://github.com/bminor/glibc/commit/0f0a5cd338998f4b603f52f3ce2163df0db7b814#diff-a4fc1e1b56b60a2598e320a232e6f631d08e0dafcfe3dd9607dde4bc8ee31eb8R473
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-02-05 9:45 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
2026-02-05 9:41 ` Li Wang via ltp
2026-02-05 10:25 ` Petr Vorel
2026-02-05 9:44 ` Petr Vorel [this message]
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=20260205094458.GA294817@pevik \
--to=pvorel@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.