]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
MUSL regtest: fix a comple of build problems building regression tests on Alpine
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 31 Mar 2023 11:39:34 +0000 (13:39 +0200)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 31 Mar 2023 11:39:34 +0000 (13:39 +0200)
memcheck/tests/linux/capget.c
memcheck/tests/linux/sys-statx.c

index ce9b18b0b0167603e8763895afd82f9c94242ed6..4ebf2f4aefe7cc7c2a696ddcb572111e0790a125 100644 (file)
@@ -1,4 +1,6 @@
-#if defined(linux)
+#include "../../../config.h"
+
+#if defined(linux) && !defined(MUSL_LIBC)
 
 
 #include <stdio.h>            /* printf() */
@@ -45,7 +47,7 @@ int main()
 
 int main()
 {
-  fprintf(stderr, "This program is Linux-specific\n");
+  fprintf(stderr, "This program is Linux with GNU libc specific\n");
   return 0;
 }
 
index fcbc2e0de773c9dcf4647aee355470c2da6fd110..3cbbd3404949621c783f1a89cfce65cea442bc12 100644 (file)
@@ -8,9 +8,14 @@
 #include <assert.h>
 #include <string.h>
 #include <sys/syscall.h>
-#ifndef HAVE_STRUCT_STATX_IN_SYS_STAT_H
+#if defined(MUSL_LIBC)
+/* musl has __NR_statx but not the structs that it needs */
+#undef __NR_statx
+#else
+#if !defined(HAVE_STRUCT_STATX_IN_SYS_STAT_H)
 #include <linux/stat.h>
-#endif
+#endif /* HAVE_STRUCT_STATX_IN_SYS_STAT_H */
+#endif /* MUSL_LIBC */
 #include <errno.h>
 
 int check_stat2;