[LTP] [PATCH] openat2: Move includes to lapi, remove _GNU_SOURCE

Li Wang liwang@redhat.com
Thu Feb 5 11:17:11 CET 2026


On Thu, Feb 05, 2026 at 10:44:58AM +0100, Petr Vorel wrote:
> > 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.

It's becuase of -D_GNU_SOURCE cflag in Makerules(which included in Makefile):
https://sourceware.org/git/?p=glibc.git;a=blob;f=Makerules;h=30c3559a285e5bc0571358ab785bf9b5d5a8f449;hb=HEAD#l1182

In case of you miss my last reply thread:
https://lists.linux.it/pipermail/ltp/2026-February/046438.html

-- 
Regards,
Li Wang



More information about the ltp mailing list