[LTP] [PATCH] lib: tst_fd: Add kernel version check to memfd_secret

Petr Vorel pvorel@suse.cz
Fri Jun 21 13:09:24 CEST 2024


Hi Nobuhiro,

> memfd_secret is a syscall added since 5.14. On earlier kernels, tests such
> as accept03, readahead01 and splice07 that use memfd_secret fail.
> This adds a kernel version check to the tst_fd library when running tests using
> memfd_secret.

Cyril's suggestion to add fallback definitions sounds to me as a good idea:

https://lore.kernel.org/ltp/ZnVCcU6jOU98DYek@yuki/

	I guess that the best fix is to add fallback definitions for
	memfd_secret into include/lapi/syscalls/*.in files. That way we should
	get -1 and EINVAL properly even when kernel does not support the
	syscall.

Could you please try that first?

Kind regards,
Petr


More information about the ltp mailing list