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

Petr Vorel pvorel@suse.cz
Tue Jan 30 11:30:52 CET 2024


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.

Kind regards,
Petr


More information about the ltp mailing list