[LTP] [PATCH v2 01/33] lapi/keyctl.h: Add fallback definitions for extended ops

Petr Vorel pvorel@suse.cz
Fri Sep 11 10:58:29 CEST 2026


> Hi!
> > --- a/m4/ltp-keyutils.m4
> > +++ b/m4/ltp-keyutils.m4
> > @@ -7,4 +7,17 @@ AC_DEFUN([LTP_CHECK_KEYUTILS_SUPPORT], [
> >  	AC_CHECK_LIB([keyutils], [add_key],
> >  	[AC_DEFINE(HAVE_LIBKEYUTILS, 1, [Define to 1 if you have libkeyutils installed.])
> >  	      AC_SUBST(KEYUTILS_LIBS, "-lkeyutils")])
> > +
> > +	LTP_KEYCTL_HEADERS=""
> > +
> > +	if test "x$ac_cv_header_keyutils_h" = "xyes" && \
> > +	   test "x$ac_cv_lib_keyutils_add_key" = "xyes"; then
> > +		LTP_KEYCTL_HEADERS="#include <keyutils.h>"
> > +	elif test "x$ac_cv_header_linux_keyctl_h" = "xyes"; then
> > +		LTP_KEYCTL_HEADERS="#include <linux/keyctl.h>"
> > +	fi
> > +
> > +	AC_CHECK_TYPES([struct keyctl_dh_params, struct keyctl_kdf_params,
> > +			struct keyctl_pkey_query, struct keyctl_pkey_params],,,
> > +			[$LTP_KEYCTL_HEADERS])
> >  ])

> Maybe we can simplify this to just linux/keyctl.h. The linux uapi header
> has been quite stable for nearly a decade.

I was going to write the same. I checked that:

struct keyctl_dh_params was added in ddbb411487243 => v4.7-rc1.
struct keyctl_kdf_params was added in f1c316a3ab9d2 => v4.12-rc1
struct keyctl_pkey_query and keyctl_pkey_params were added in 00d60fd3b9321 => v4.20-rc1

And please move it to configure.ac.
(Ideally we would slowly simplify and move all m4/ltp-*.m4 to configure.ac.)

Anyway, very nice patchset, thanks!

Kind regards,
Petr


More information about the ltp mailing list