syscalls/profil01: Fix build for libc without profil() support
PATCH v2 1/1 syscalls/profil01: Fix build for libc without profil() support
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 <[email protected]>
Reported-by Erico Nunes <[email protected]>
--- configure.ac | 2 ++ testcases/kernel/syscalls/profil/profil01.c | 9 +++++++++ 2 files changed, 11 insertions(+)
configure.ac +2 -0
@@ -46,6 +46,8 @@ AC_CHECK_HEADERS([ \ sys/prctl.h \ ]) +AC_CHECK_FUNCS([profil]) + # Tools knobs # Expect
testcases/kernel/syscalls/profil/profil01.c +9 -0
@@ -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
Signature · 1 line
2.14.2
PATCH v2 1/1 syscalls/profil01: Fix build for libc without profil() support
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.
Signature · 2 lines
Cyril Hrubis [email protected]