[LTP] [PATCH v2 1/2] keyctl: Vendor struct keyctl_dh_params

Petr Vorel pvorel@suse.cz
Tue Sep 22 16:39:13 CEST 2026


Hi Cyril,

> Hi!
> I think that we should simplify this by including only
> include/linux/keyctl.h and do not ever include the include/keyutils.h
> from keyutils package.

> This should do the trick:

> diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
> index fdb68d172..90ebf88c1 100644
> --- a/include/lapi/keyctl.h
> +++ b/include/lapi/keyctl.h
> @@ -10,15 +10,13 @@

>  #include <stdint.h>

> -#if defined(HAVE_KEYUTILS_H) && defined(HAVE_LIBKEYUTILS)
> -# include <keyutils.h>
> -#else
> -# ifdef HAVE_LINUX_KEYCTL_H
> -#  include <linux/keyctl.h>
> -# endif /* HAVE_LINUX_KEYCTL_H */
> -
> -# include <stdarg.h>
> -# include "lapi/syscalls.h"
> +#ifdef HAVE_LINUX_KEYCTL_H
> +# include <linux/keyctl.h>
> +#endif /* HAVE_LINUX_KEYCTL_H */
> +
> +#include <stdarg.h>
> +#include "lapi/syscalls.h"
> +
>  typedef int32_t key_serial_t;

>  static inline key_serial_t add_key(const char *type,
> @@ -59,11 +57,12 @@ static inline key_serial_t keyctl_join_session_keyring(const char *name) {
>         return keyctl(KEYCTL_JOIN_SESSION_KEYRING, name);
>  }

> -#endif /* defined(HAVE_KEYUTILS_H) && defined(HAVE_LIBKEYUTILS) */
> -
>  #ifndef HAVE_STRUCT_KEYCTL_DH_PARAMS
>  struct keyctl_dh_params {
> -       int32_t priv;
> +       union {
> +               int32_t priv;
> +               int32_t private;
> +       };

I see now :). Good point, I'll remove the rest of keyutils + use private instead
of priv and send whole patchset asap.

Kind regards,
Petr

>         int32_t prime;
>         int32_t base;
>  };


More information about the ltp mailing list