[LTP] [PATCH v3] Replace ltp_syscall with tst_syscall

Petr Vorel pvorel@suse.cz
Mon Jan 24 21:48:08 CET 2022


Hi Andrea,

> diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh
> index d7daf8ad0..77391dbdf 100755
> --- a/include/lapi/syscalls/regen.sh
> +++ b/include/lapi/syscalls/regen.sh
> @@ -35,21 +35,17 @@ cat << EOF > "${output_pid}"
>  #include <asm/unistd.h>
>  #include "cleanup.c"

> -#define ltp_syscall(NR, ...) ({ \\
> -	int __ret; \\
> -	if (NR == __LTP__NR_INVALID_SYSCALL) { \\
> -		errno = ENOSYS; \\
> -		__ret = -1; \\
> -	} else { \\
> -		__ret = syscall(NR, ##__VA_ARGS__); \\
> -	} \\
> -	if (__ret == -1 && errno == ENOSYS) { \\
> -		tst_brkm(TCONF, CLEANUP, \\
> -			"syscall(%d) " #NR " not supported on your arch", \\
> -			NR); \\
> -	} \\
> -	__ret; \\
> +#ifdef TST_TEST_H__
> +#define TST_SYSCALL_BRK__(NR) ({ \
> +	tst_brk(TCONF, \
> +		"syscall(%d) " #NR " not supported on your arch", NR); \
> +})
> +#else
> +#define TST_SYSCALL_BRK__(NR) ({ \
> +	tst_brkm(TCONF, CLEANUP, \
> +		"syscall(%d) " #NR " not supported on your arch", NR); \
>  })
> +#endif
I miss this in my review. Cyril meant to put double backslashes also
here in regen.sh (as it was in original version). The result is then:

#ifdef TST_TEST_H__
#define TST_SYSCALL_BRK__(NR) ({ 	tst_brk(TCONF, 		"syscall(%d) " #NR " not supported on your arch", NR); })
#else
#define TST_SYSCALL_BRK__(NR) ({ 	tst_brkm(TCONF, CLEANUP, 		"syscall(%d) " #NR " not supported on your arch", NR); })
#endif

instead of:

#ifdef TST_TEST_H__
#define TST_SYSCALL_BRK__(NR) ({ \
	tst_brk(TCONF, \
		"syscall(%d) " #NR " not supported on your arch", NR); \
})
#else
#define TST_SYSCALL_BRK__(NR) ({ \
	tst_brkm(TCONF, CLEANUP, \
		"syscall(%d) " #NR " not supported on your arch", NR); \
})
#endif

Merging it with this fix.

Thanks a lot!

Kind regards,
Petr


More information about the ltp mailing list