]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add sysinfo to show sizeof(time_t)
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 16 Apr 2023 07:11:49 +0000 (09:11 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 22 Dec 2023 10:45:31 +0000 (11:45 +0100)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tests/helpers/test_sysinfo.c

index 692a84601737c09cb67abaedb5e05e2165d9c6dd..c36aca2b5c3a9edae034a06ae1d59d1e9f02c64c 100644 (file)
@@ -25,6 +25,7 @@
 #include <inttypes.h>
 #include <wchar.h>
 #include <errno.h>
+#include <time.h>
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 
@@ -125,6 +126,12 @@ static int hlp_fsopen_ok(void)
        return 0;
 }
 
+static int hlp_sz_time(void)
+{
+       printf("%zu\n", sizeof(time_t));
+       return 0;
+}
+
 static const mntHlpfnc hlps[] =
 {
        { "WORDSIZE",   hlp_wordsize    },
@@ -139,6 +146,7 @@ static const mntHlpfnc hlps[] =
        { "wcsspn-ok",  hlp_wcsspn_ok   },
        { "enotty-ok",  hlp_enotty_ok   },
        { "fsopen-ok",  hlp_fsopen_ok   },
+       { "sz(time_t)", hlp_sz_time     },
        { NULL, NULL }
 };