]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (configs) check for scandirat()
authorKarel Zak <kzak@redhat.com>
Wed, 15 Oct 2025 09:34:26 +0000 (11:34 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 15 Oct 2025 09:34:26 +0000 (11:34 +0200)
The function may be unsupported on musl libc.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/helpers/test_sysinfo.c
tests/ts/misc/configs

index 001f8599eb0407ba4e5c63ee0d44d49bde703c8d..47c5eeda4a41231f13002be9781f6bf9c66d3226 100644 (file)
@@ -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     },
index c56caaf697adbc6670a8d4753b2fb7fa60451709..2f7aacacce53ac0c29c420cf87e667903b0bac32 100755 (executable)
@@ -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