From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] Rewrite getcontext01.c test using new LTP API
Date: Wed, 16 Feb 2022 12:49:55 +0100 [thread overview]
Message-ID: <Ygzk49BrnQVs+6Vc@pevik> (raw)
In-Reply-To: <20220216104026.18326-1-andrea.cervesato@suse.de>
Hi Andrea,
> Removed old LTP API from getcontext01.c test and check if getcontext is
> present in the current system. The check is useful in those systems
> where libmusl is used by default.
nit: "libmusl": it's musl libc or just musl (https://musl.libc.org/about.html).
I got really confused you mean some other library on the top of musl
(e.g. there is musl-fts implementation https://github.com/void-linux/musl-fts
because musl refuses to implement fts.h).
> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
> ---
> configure.ac | 1 +
> .../kernel/syscalls/getcontext/getcontext01.c | 93 +++++--------------
> 2 files changed, 24 insertions(+), 70 deletions(-)
> diff --git a/configure.ac b/configure.ac
> index 8d2c5b1c4..41a21a636 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -97,6 +97,7 @@ AC_CHECK_FUNCS_ONCE([ \
> fspick \
> fstatat \
> getauxval \
> + getcontext \
I was surprised that getcontext is still not in musl (but it's in ucontext.h header),
but it's deliberate:
https://wiki.musl-libc.org/open-issues.html#ucontext.h
Also not sure if it's in bionic
(https://android.googlesource.com/platform/bionic).
Thus ack using autotools (I'm trying to remove old unneeded check to speedup
configure runtime).
It might be worth to add .test_variants to test raw syscall,
but that'd be another effort (no need to bother with it now).
> TEST(getcontext(&ptr));
...
> + if (TST_RET < 0)
> + tst_res(TFAIL, "getcontext: %s", tst_strerrno(TST_ERR));
...
> + if (TST_RET == 0)
> + tst_res(TPASS, "getcontext passed");
> + else
> + tst_res(TFAIL, "Unexpected return value %li", TST_RET);
> }
For this code:
if (TST_RET < 0)
tst_res(TFAIL, "getcontext: %s", tst_strerrno(TST_ERR));
I'd personally add else if here below:
if (TST_RET == 0)
tst_res(TPASS, "getcontext passed");
else
tst_res(TFAIL, "Unexpected return value %li", TST_RET);
But how about instead of all this just using
TST_EXP_PASS(getcontext(&ptr));
...
> +static struct tst_test test = {
> + .test_all = run,
> +};
> #else /* systems that dont support obsolete getcontext */
I'm going to remove this useless comment before merge ^
> -int main(void)
> -{
> - tst_brkm(TCONF, NULL, "system doesn't have getcontext support");
> -}
> +TST_TEST_TCONF("system doesn't have getcontext support");
> #endif
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2022-02-16 11:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 10:40 [LTP] [PATCH v1] Rewrite getcontext01.c test using new LTP API Andrea Cervesato
2022-02-16 11:49 ` Petr Vorel [this message]
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=Ygzk49BrnQVs+6Vc@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.de \
--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.