From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/2] openat2: define _GNU_SOURCE and include <fcntl.h>
Date: Wed, 4 Feb 2026 23:27:53 +0100 [thread overview]
Message-ID: <20260204222753.GA279256@pevik> (raw)
In-Reply-To: <aYNVsiL4xf2P9R6A@redhat.com>
Hi Li,
...
> > lapi/openat2.h uses struct open_how directly, shouldn't be included lapi/fcntl.h
> > there?
> From my understand lapi/* are appendix for missing stuff in header file.
Yes, but we agreed in the past, that it's better to include relevant libc/kernel
header in the lapi header [1]:
LAPI header should always include original header.
[1] https://github.com/linux-test-project/ltp/blob/master/doc/old/C-Test-API.asciidoc#lapi-headers
I thought we had a discussion about it, but now I see nobody acked the change in
ML (cfbc41d775), therefore I somehow pushed this approach without consensus with
others. I'm sorry for that, we can revise that. At the moment quite a few lapi
headers use this approach (likely majority).
IMHO it's better to include it than expect that all tests which use lapi header
will include relevant header *before* (otherwise tests can happily always depend
on fallback instead of using a real value from a system header).
It's a minor detail, but being consistent helps for newcomers to understand
LTP code.
And *if* we agree on it, it should be now doc/developers/ground_rules.rst.
Also there is a different approach where should be fallbacks. We use some lapi
headers (e.g. lapi/openat2.h but there are more) which don't have public
equivalent in libc (/usr/include/bits/openat2.h cannot be used directly, but via
<fcntl.h>). Therefore I would put content of lapi/openat2.h into lapi/fcntl.h,
but that's a minor detail.
> Test cases should only include standard header files, and lapi should
> only be used in case of missing or conflicting header files.
But lapi/openat2.h also uses struct open_how. I would either include <fcntl.h>
in both sources or just in lapi/openat2.h. Having it only in tests looks to me
as not ideal.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-02-04 22:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 2:43 [LTP] [PATCH v2 1/2] openat2: define _GNU_SOURCE and include <fcntl.h> Li Wang via ltp
2026-02-03 2:43 ` [LTP] [PATCH v2 2/2] newlib_tests: add tst_filesystems01 to .gitignore Li Wang via ltp
2026-02-04 11:57 ` Petr Vorel
2026-02-04 12:05 ` Li Wang via ltp
2026-02-04 12:26 ` Petr Vorel
2026-02-04 12:23 ` [LTP] [PATCH v2 1/2] openat2: define _GNU_SOURCE and include <fcntl.h> Petr Vorel
2026-02-04 14:20 ` Li Wang via ltp
2026-02-04 22:27 ` Petr Vorel [this message]
2026-02-05 1:44 ` Li Wang via ltp
2026-02-05 10:08 ` Petr Vorel
2026-02-05 10:33 ` 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=20260204222753.GA279256@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox