selftests: kselftest: Fix build failure with NOLIBC

As Mark explains ksft_min_kernel_version() can't be compiled with nolibc,
it doesn't implement uname().

Fixes: 6d029c25b71f ("selftests/timers/posix_timers: Reimplement check_timer_distribution()")
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240412123536.GA32444@redhat.com
Closes: https://lore.kernel.org/all/f0523b3a-ea08-4615-b0fb-5b504a2d39df@sirena.org.uk/

authored by Oleg Nesterov and committed by Thomas Gleixner 16767502 ed366de8

Changed files
+5
tools
testing
selftests
+5
tools/testing/selftests/kselftest.h
··· 395 395 static inline int ksft_min_kernel_version(unsigned int min_major, 396 396 unsigned int min_minor) 397 397 { 398 + #ifdef NOLIBC 399 + ksft_print_msg("NOLIBC: Can't check kernel version: Function not implemented\n"); 400 + return 0; 401 + #else 398 402 unsigned int major, minor; 399 403 struct utsname info; 400 404 ··· 406 402 ksft_exit_fail_msg("Can't parse kernel version\n"); 407 403 408 404 return major > min_major || (major == min_major && minor >= min_minor); 405 + #endif 409 406 } 410 407 411 408 #endif /* __KSELFTEST_H */