* [LTP] [PATCH v2 1/1] syscalls/profil01: Fix build for libc without profil() support
@ 2017-10-02 13:33 Petr Vorel
2017-10-10 14:26 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2017-10-02 13:33 UTC (permalink / raw)
To: ltp
uClibc and uClibc-ng (at least) have no profil() support atm.
Patch taken from buildroot project (thanks!), adjusted it not to be
only uClibc/uClibc-ng specific.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reported-by: Erico Nunes <nunes.erico@gmail.com>
---
configure.ac | 2 ++
testcases/kernel/syscalls/profil/profil01.c | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/configure.ac b/configure.ac
index 458a5b13f..465655e7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,8 @@ AC_CHECK_HEADERS([ \
sys/prctl.h \
])
+AC_CHECK_FUNCS([profil])
+
# Tools knobs
# Expect
diff --git a/testcases/kernel/syscalls/profil/profil01.c b/testcases/kernel/syscalls/profil/profil01.c
index 2fc47aaf5..ff330d0b9 100644
--- a/testcases/kernel/syscalls/profil/profil01.c
+++ b/testcases/kernel/syscalls/profil/profil01.c
@@ -28,6 +28,8 @@
#include "test.h"
#include "safe_macros.h"
+#if HAVE_PROFIL
+
#define PROFIL_TIME 5
/* Should be large enough to hold data for test_profil() .text,
@@ -37,6 +39,7 @@
#define PROFIL_BUFLEN (32*1024)
char *TCID = "profil01";
+
int TST_TOTAL = 1;
static volatile sig_atomic_t profil_done;
@@ -124,3 +127,9 @@ int main(int ac, char *av[])
tst_exit();
}
+#else /* systems without profil() */
+int main(void)
+{
+ tst_brkm(TCONF, NULL, "system doesn't have profil() support");
+}
+#endif
--
2.14.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH v2 1/1] syscalls/profil01: Fix build for libc without profil() support
2017-10-02 13:33 [LTP] [PATCH v2 1/1] syscalls/profil01: Fix build for libc without profil() support Petr Vorel
@ 2017-10-10 14:26 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2017-10-10 14:26 UTC (permalink / raw)
To: ltp
Hi!
I've fixed the patch and pushed, thanks.
I've added #include "config.h" so that the test is actually enabled when
configure finds that profil is implemented and also suffled the TCID
before the #ifdef so that it's defined for the TCONF branch as well.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-10 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-02 13:33 [LTP] [PATCH v2 1/1] syscalls/profil01: Fix build for libc without profil() support Petr Vorel
2017-10-10 14:26 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.