This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Skip deleted test if fork(2) is unavailable
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Thu, 4 May 2017 11:59:57 +0200
- Subject: [PATCH] Skip deleted test if fork(2) is unavailable
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TNDT41z193iL4/ByWAhv5l6hO0y0JmDCjuBh7I0XM88=; b=GTOcPmYxDUp22rz+V6TU985CEFAgTBzEhsQLV2itZa8eORMPmzlZIP3m60gZM9+zPdfqRM7C1XqvCwaAGniFfrhKBIKa2s1x8Ko/LRVwmonkEJYYAf9E+HnR5AmFva2quxib/dunFLkJajPHigsa6yLIY83eqOjt1Yf2fDZfRkA=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
ChangeLog | 4 ++++
configure.ac | 1 +
tests/ChangeLog | 4 ++++
tests/deleted.c | 14 ++++++++++++++
4 files changed, 23 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 662c633..2cf7bd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+ * configure.ac: Check for fork().
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
* configure.ac: Check for posix_fallocate, posix_fadvise, fchown,
fchmod.
diff --git a/configure.ac b/configure.ac
index 6cbd70d..5fa20c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -608,6 +608,7 @@ AM_CONDITIONAL(HAVE_FEATURES_H, [test "x$ac_cv_header_features_h" = "xyes"])
AC_CHECK_HEADERS(stdio_ext.h)
AM_CONDITIONAL(HAVE_STDIO_EXT_H, [test "x$ac_cv_header_stdio_ext_h" = "xyes"])
+AC_CHECK_DECLS([fork], [], [], [[#include <unistd.h>]])
AC_CHECK_DECLS([feof_unlocked, ferror_unlocked, fputc_unlocked, fputs_unlocked,
fwrite_unlocked, putc_unlocked, putchar_unlocked],
[], [], [[#include <stdio.h>]])
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c2619d0..611b88a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,9 @@
2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+ * deleted.c: If fork() is unavailable, skip the test.
+
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
* allfcts.c: Use fprintf and exit rather than err and errx.
* buildid.c: Likewise.
* debugaltlink.c: Likewise.
diff --git a/tests/deleted.c b/tests/deleted.c
index 6be35bc..f11cb1b 100644
--- a/tests/deleted.c
+++ b/tests/deleted.c
@@ -29,6 +29,18 @@
extern void libfunc (void);
+#if !HAVE_DECL_FORK
+
+int
+main (int argc __attribute__ ((unused)), char **argv)
+{
+ fprintf (stderr, "%s: fork() not supported for this architecture\n",
+ argv[0]);
+ return 77;
+}
+
+#else
+
int
main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)))
{
@@ -56,3 +68,5 @@ main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)))
printf ("%d\n", pid);
return EXIT_SUCCESS;
}
+
+#endif
--
2.1.4