Re: [LTP] [PATCH 1/2] Add tst_is_compat_mode() helper function

Petr Vorel
2024-01-30T10:31:13Z

Hi Martin,

> New helper function to simplify checks whether the test process runs
> in e.g. 32bit compat mode on 64bit kernel.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

...
> +int tst_is_compat_mode(void)
> +{
> + return TST_ABI != tst_kernel_bits();

BTW setsockopt03.c and setsockopt08.c use:
if (tst_kernel_bits() == 32 || sizeof(long) > 4)

I guess they could also use tst_is_compat_mode().

And we have .skip_in_compat = 1, we could also add .require_compat (for
documentation purposes.