[LTP] [CI FAILURE] Re: [PATCH v4] Add test for UI_GET_NAME ioctl

Cyril Hrubis chrubis@suse.cz
Tue Oct 24 11:33:00 CEST 2023


Hi!
> > I've adjusted the FAIL/PASS messages and pushed, thanks.
> 
> UI_GET_NAME() from include/uapi/linux/uinput.h is not on the old CentOS 7 we
> still support:
> 
> https://github.com/linux-test-project/ltp/actions/runs/6614554688/job/17964785134
> /__w/ltp/ltp/testcases/kernel/input/input_helper.c:194:2: error: implicit declaration of function 'UI_GET_SYSNAME' [-Werror=implicit-function-declaration]
>   SAFE_IOCTL(NULL, fd, UI_GET_SYSNAME(sizeof(sys_name)), sys_name, NULL);
>   ^
> 
> I'll have look later today for the fix. I suppose we need lapi/uinput.h with
> adds a fallback definition. It was added in kernel v3.15 in
> e3480a61fca7 ("Input: uinput - add UI_GET_SYSNAME ioctl to retrieve the sysfs path")
> 
> Also, there is also an API version change, we could use this if simple ifndef
> UI_GET_SYSNAME + fallback will not be enough (e.g. test fails because it
> requires newer kernel API).
> 
> -#define UINPUT_VERSION         3
> +#define UINPUT_VERSION         4

Given that UI_GET_SYSNAME is a macro we can do as well:

#ifndef UI_GET_SYSNAME
# define UI_GET_SYSNAME(len) ...
#endif

However at the same time we would need to actually check if the ioctl is
supported or not, because if the CentOS 7 kernel does not support
UI_GET_SYSNAME ioctl() the SAFE_IOCTL() will fail with EINVAL.

Also looking at the linux/uinput.h there are three more ioctls() added
in version 5 that should be tested as well. I suppose that we will need
add an issue for that.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list