On 2026-02-05 22:23:29+0000, Jordan Richards wrote:
> From: Pasha Tatashin <[email protected]>
(...)
> diff --git a/tools/testing/selftests/liveupdate/luo_test_utils.c
> b/tools/testing/selftests/liveupdate/luo_test_utils.c
> index 3c8721c505df..100dc0f69f37 100644
> --- a/tools/testing/selftests/liveupdate/luo_test_utils.c
> +++ b/tools/testing/selftests/liveupdate/luo_test_utils.c
> @@ -20,9 +20,14 @@
> #include <sys/stat.h>
> #include <errno.h>
> #include <stdarg.h>
> +#include <linux/unistd.h>
>
> #include "luo_test_utils.h"
>
> +#ifdef NOLIBC
> +#include <sys.h>
> +#endif
This should not be necessary.
I am actively trying to get rid of the checks for the NOLIBC macro.
> +
> int luo_open_device(void)
> {
> return open(LUO_DEVICE, O_RDWR);
(...)
> @@ -45,8 +50,8 @@ int luo_retrieve_session(int luo_fd, const char *name)
> {
> struct liveupdate_ioctl_retrieve_session arg = { .size = sizeof(arg) };
>
> - snprintf((char *)arg.name, LIVEUPDATE_SESSION_NAME_LENGTH, "%.*s",
> - LIVEUPDATE_SESSION_NAME_LENGTH - 1, name);
> + strncpy((char *)arg.name, name, LIVEUPDATE_SESSION_NAME_LENGTH);
> + arg.name[LIVEUPDATE_SESSION_NAME_LENGTH - 1] = '\0';
FWIW we are currently working on "%.*s" support.
>
> if (ioctl(luo_fd, LIVEUPDATE_IOCTL_RETRIEVE_SESSION, &arg) < 0)
> return -errno;
(...)