diff options
| author | Karel Zak <kzak@redhat.com> | 2025-10-15 11:34:26 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2025-10-15 11:34:26 +0200 |
| commit | d2ac69cc315d8e20fd880d5fcf17ee6a2767bfc7 (patch) | |
| tree | 6c20857c33ff9c7738c98136f2f6b990411f4036 | |
| parent | bb65b1701399bb7f9148a4cac56a8158ad369125 (diff) | |
| download | util-linux-d2ac69cc315d8e20fd880d5fcf17ee6a2767bfc7.tar.gz | |
tests: (configs) check for scandirat()
The function may be unsupported on musl libc.
Signed-off-by: Karel Zak <kzak@redhat.com>
| -rw-r--r-- | tests/helpers/test_sysinfo.c | 13 | ||||
| -rwxr-xr-x | tests/ts/misc/configs | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/helpers/test_sysinfo.c b/tests/helpers/test_sysinfo.c index 001f8599eb..47c5eeda4a 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 c56caaf697..2f7aacacce 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 |
