Linux Test Project
 help / color / mirror / Atom feed
From: gang.yan@linux.dev
To: "Andrea Cervesato" <andrea.cervesato@suse.com>
Cc: Gang Yan <yangang@kylinos.cn>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/3] generate_syscall.sh: add a helper named tst_syscall_base
Date: Wed, 15 Jul 2026 03:04:55 +0000	[thread overview]
Message-ID: <a303ea8d1d9ddd3f8dc62fe47c9498005ce2fe10@linux.dev> (raw)
In-Reply-To: <6a56189c.d419c4af.35af2f.7b5a@mx.google.com>

July 14, 2026 at 7:08 PM, "Andrea Cervesato" <andrea.cervesato@suse.com mailto:andrea.cervesato@suse.com?to=%22Andrea%20Cervesato%22%20%3Candrea.cervesato%40suse.com%3E > wrote:


> 
> Hi Gang,
> 
> > 
> > From: Gang Yan <yangang@kylinos.cn>
> >  
> >  This patch adds a helper named tst_syscall_base, it can check the
> >  syscall on older distros without tst_brk.
> >  
> >  Signed-off-by: Gang Yan <yangang@kylinos.cn>
> >  ---
> >  include/lapi/syscalls/generate_syscalls.sh | 27 +++++++++++++---------
> >  1 file changed, 16 insertions(+), 11 deletions(-)
> >  
> >  diff --git a/include/lapi/syscalls/generate_syscalls.sh b/include/lapi/syscalls/generate_syscalls.sh
> >  index 19f280dfb..95c2c9aeb 100755
> >  --- a/include/lapi/syscalls/generate_syscalls.sh
> >  +++ b/include/lapi/syscalls/generate_syscalls.sh
> >  @@ -49,18 +49,23 @@ tst_brkm(TCONF, dummy_cleanup, \
> >  })
> >  #endif
> >  
> >  +#define tst_syscall_base(NR, ...) ({ \
> >  + intptr_t tst_ret; \
> >  + if (NR == __LTP__NR_INVALID_SYSCALL) { \
> >  + errno = ENOSYS; \
> >  + tst_ret = -1; \
> >  + } else { \
> >  + tst_ret = syscall(NR, ##__VA_ARGS__); \
> >  + } \
> >  + tst_ret; \
> >  +})
> > 
Hi Andrea,

Thanks for your review.

> Do we really need this? If we don't define memfd_secret, we really want
> to get a TCONF. And the function is used in a weird way.

You are right. I've confirmed that syscall(-1) returning a positive
value is a glibc or kernel bug on loongarch64, syscall(-1) should return
-1, but return 38 (ENONSYS) in my enviroment. It is not something LTP should
work around.


> 
> If you need to add the support for memfd_secret, please just update the
> syscalls files via:
> 
> ./include/lapi/syscalls/generate_arch.sh <path to linux sources>
> 
> We don't update .in files manually since it's error prone.
>

Thanks again

Cherrs
Gang 
> Regards,
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com mailto:andrea.cervesato@suse.com
>

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-07-15  3:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 10:14 [LTP] [PATCH 0/3] tst_fd.c: fix test_failures on loongarch's old Gang Yan
2026-07-14 10:14 ` [LTP] [PATCH 1/3] loongarch.in: add memfd_secret syscall Gang Yan
2026-07-14 10:54   ` [LTP] " linuxtestproject.agent
2026-07-14 10:14 ` [LTP] [PATCH 2/3] generate_syscall.sh: add a helper named tst_syscall_base Gang Yan
2026-07-14 11:08   ` Andrea Cervesato via ltp
2026-07-15  3:04     ` gang.yan [this message]
2026-07-14 10:14 ` [LTP] [PATCH 3/3] tst_fd.c: replace syscall() with tst_syscall_base() Gang Yan

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=a303ea8d1d9ddd3f8dc62fe47c9498005ce2fe10@linux.dev \
    --to=gang.yan@linux.dev \
    --cc=andrea.cervesato@suse.com \
    --cc=ltp@lists.linux.it \
    --cc=yangang@kylinos.cn \
    /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