From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1 01/10] Add SAFE_STATX macro
Date: Thu, 16 May 2024 18:27:23 +0200 [thread overview]
Message-ID: <20240516162723.GC317330@pevik> (raw)
In-Reply-To: <2f999e65-26e6-442e-886e-7f98cce6dd19@suse.com>
Hi Andrea,
> Hi,
...
> > > > > +++ b/include/tst_safe_macros.h
> > > > > @@ -503,4 +503,11 @@ int safe_sscanf(const char *file, const int lineno, const char *restrict buffer,
> > > > > #define SAFE_SSCANF(buffer, format, ...) \
> > > > > safe_sscanf(__FILE__, __LINE__, (buffer), (format), ##__VA_ARGS__)
> > > > > +struct statx;
> > > > Could you please remove this? (unneeded)
> > > That's needed because in some distro statx is not defined before reaching
> > > that line causing build failure.
> > <sys/stat.h> are included in lapi/stat.h. I wonder if <linux/stat.h> would fail.
> It's related with distros which need to use fallback. There's no fallback of
> "struct statx" when defining the
> statx() syscall wrapper, so it fails during build.
OK, struct statx is at least on musl guarded with _GNU_SOURCE, that's why
struct statx in the header helps. This is better than define _GNU_SOURCE also
for the header (it's in tst_safe_macros.c). But it would be good to document
this (either in the commit message or in the source) - I always wonder when
staring in various workarounds like this few years later and wondering if it can
be removed.
I was thinking it would be possible to switch to <linux/stat.h> and we would
save the detection. But given struct statx is used in tst_safe_macros.h,
we would need to replace all <sys/stat.h> with <linux/stat.h> also in the tests
which use tst_safe_macros.h:
$ git grep -l tst_safe_macros.h $(git grep -l -e include..lapi/stat.h -e include..sys/stat.h) | wc -l
8
But I don't think it's a good idea to switch to <linux/stat.h>.
Kind regards,
Petr
> > If the definition later works it should be fixable by including the needed
> > header in lapi/stat.h, right?
> > Could you post link to CI job which failed?
> > Kind regards,
> > Petr
> > > > With that, you might add for this patch in the next version:
> > > > Reviewed-by: Petr Vorel <pvorel@suse.cz>
> > > > Kind regards,
> > > > Petr
> > > Andrea
> Andrea
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-05-16 16:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 9:33 [LTP] [PATCH v1 00/10] statmount/listmount testing suites Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 01/10] Add SAFE_STATX macro Andrea Cervesato
2024-05-16 1:30 ` Petr Vorel
2024-05-16 11:50 ` Andrea Cervesato via ltp
2024-05-16 14:49 ` Petr Vorel
2024-05-16 14:59 ` Andrea Cervesato via ltp
2024-05-16 16:27 ` Petr Vorel [this message]
2024-05-15 9:33 ` [LTP] [PATCH v1 02/10] Add listmount/statmount fallback declarations Andrea Cervesato
2024-05-16 1:22 ` Petr Vorel
2024-05-15 9:33 ` [LTP] [PATCH v1 03/10] Add listmount01 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 04/10] Add listmount02 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 05/10] Add stamount01 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 06/10] Add statmount02 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 07/10] Add statmount03 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 08/10] Add statmount04 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 09/10] Add statmount05 test Andrea Cervesato
2024-05-15 9:33 ` [LTP] [PATCH v1 10/10] Add statmount06 test Andrea Cervesato
2024-05-15 10:31 ` [LTP] [PATCH v1 00/10] statmount/listmount testing suites Andrea Cervesato 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=20240516162723.GC317330@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.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.