mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Use execinfo.h only on glibc
libunwind could also work on musl but that would require more drastic code changes Github-ID: https://github.com/ibm-s390-linux/s390-tools/pull/193 Signed-off-by: Sertonix <sertonix@posteo.net> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com> Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -9,12 +9,14 @@
|
||||
* it under the terms of the MIT license. See LICENSE for details.
|
||||
*/
|
||||
|
||||
#include <execinfo.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/time.h>
|
||||
#ifdef __GLIBC__
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
#include "lib/util_base.h"
|
||||
#include "lib/util_panic.h"
|
||||
@@ -24,6 +26,7 @@
|
||||
*
|
||||
* To get symbols, link the code with "-rdynamic".
|
||||
*/
|
||||
#ifdef __GLIBC__
|
||||
static void print_backtrace(void)
|
||||
{
|
||||
void *array[256];
|
||||
@@ -42,6 +45,9 @@ static void print_backtrace(void)
|
||||
|
||||
free(strings);
|
||||
}
|
||||
#else
|
||||
static void print_backtrace(void) {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check for core ulimit
|
||||
|
||||
Reference in New Issue
Block a user