Re: [PATCH 2/3] generate_syscall.sh: add a helper named tst_syscall_base

Andrea Cervesato via ltp <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Gang,

> From: Gang Yan <yangang-UOlijcLmZ/[email protected]>
> 
> 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-UOlijcLmZ/[email protected]>
> ---
>  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; \
> +})

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.

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.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato-IBi9RG/[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.