From: Karel Zak Date: Wed, 15 Oct 2025 09:34:26 +0000 (+0200) Subject: tests: (configs) check for scandirat() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2ac69cc315d8e20fd880d5fcf17ee6a2767bfc7;p=thirdparty%2Futil-linux.git tests: (configs) check for scandirat() The function may be unsupported on musl libc. Signed-off-by: Karel Zak --- diff --git a/tests/helpers/test_sysinfo.c b/tests/helpers/test_sysinfo.c index 001f8599e..47c5eeda4 100644 --- a/tests/helpers/test_sysinfo.c +++ b/tests/helpers/test_sysinfo.c @@ -149,6 +149,18 @@ static int hlp_fsopen_ok(void) return 0; } +static int hlp_scandirat_ok(void) +{ + printf("%d\n", +#ifdef HAVE_SCANDIRAT + 1 +#else + 0 +#endif + ); + return 0; +} + static int hlp_statmount_ok(void) { printf("%d\n", @@ -321,6 +333,7 @@ static const mntHlpfnc hlps[] = { "wcsspn-ok", hlp_wcsspn_ok }, { "enotty-ok", hlp_enotty_ok }, { "fsopen-ok", hlp_fsopen_ok }, + { "scandirat-ok", hlp_scandirat_ok }, { "statmount-ok", hlp_statmount_ok }, { "listmount-ok", hlp_listmount_ok }, { "sz(time_t)", hlp_sz_time }, diff --git a/tests/ts/misc/configs b/tests/ts/misc/configs index c56caaf69..2f7aacacc 100755 --- a/tests/ts/misc/configs +++ b/tests/ts/misc/configs @@ -13,6 +13,8 @@ TS_DESC="configs" . "$TS_TOPDIR"/functions.sh ts_init "$*" +[ "$("$TS_HELPER_SYSINFO" scandirat-ok)" = "1" ] || ts_skip "no scandirat" + ts_check_test_command "$TS_HELPER_CONFIGS" # Create test directory structure