1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
diff --git a/lib/dnscore/src/debug.c b/lib/dnscore/src/debug.c
index e3b6f8f..c52692a 100644
--- a/lib/dnscore/src/debug.c
+++ b/lib/dnscore/src/debug.c
@@ -52,7 +52,7 @@
#include "dnscore/dnscore-config.h"
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__GLIBC__) || defined(__APPLE__)
#include <execinfo.h>
#if HAS_BFD_DEBUG_SUPPORT
#include <bfd.h>
@@ -80,7 +80,7 @@
#undef debug_stat
#undef debug_mallocated
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__GLIBC__) || defined(__APPLE__)
#define ZDB_DEBUG_STACKTRACE 1
#else /* __FreeBSD__ or unknown */
#define ZDB_DEBUG_STACKTRACE 0
@@ -596,7 +596,7 @@ debug_stacktraces_list_set_search(void* data, void* parm)
stacktrace
debug_stacktrace_get()
{
-#ifdef __linux__
+#ifdef __GLIBC__
void* buffer_[1024];
int n = backtrace(buffer_, sizeof(buffer_) / sizeof(void*));
@@ -693,7 +693,7 @@ debug_stacktrace_clear()
void
debug_stacktrace_log(logger_handle* handle, u32 level, stacktrace trace)
{
-#ifdef __linux__
+#ifdef __GLIBC__
int n = 0;
if(trace != NULL)
@@ -753,7 +753,7 @@ debug_stacktrace_log(logger_handle* handle, u32 level, stacktrace trace)
void
debug_stacktrace_try_log(logger_handle* handle, u32 level, stacktrace trace)
{
-#ifdef __linux__
+#ifdef __GLIBC__
int n = 0;
if(trace != NULL)
@@ -819,7 +819,7 @@ debug_stacktrace_print(output_stream *os, stacktrace trace)
return;
}
-#ifdef __linux__
+#ifdef __GLIBC__
int n = 0;
while(trace[n] != 0)
@@ -911,7 +911,7 @@ debug_dump_ex(void* data_pointer_, size_t size_, size_t line_size, bool hex, boo
/****************************************************************************/
-#if defined(__linux__)
+#if defined(__GLIBC__)
bool
debug_log_stacktrace(logger_handle *handle, u32 level, const char *prefix)
@@ -921,7 +921,7 @@ debug_log_stacktrace(logger_handle *handle, u32 level, const char *prefix)
char binary[PATH_MAX];
#endif
-#if defined(__linux__)
+#if defined(__GLIBC__)
int n = backtrace(addresses, sizeof(addresses) / sizeof(void*));
diff --git a/sbin/yadifad/signals.c b/sbin/yadifad/signals.c
index bc83eaf..a4a5546 100644
--- a/sbin/yadifad/signals.c
+++ b/sbin/yadifad/signals.c
@@ -54,7 +54,7 @@
#include <sys/stat.h>
#include <fcntl.h>
-#if defined(__linux__) || defined(__gnu_hurd__)
+#if defined(__GLIBC__) || defined(__gnu_hurd__)
#define _GNU_SOURCE 1
#include <execinfo.h>
#include <sys/mman.h>
@@ -587,7 +587,7 @@ signal_handler(int signo, siginfo_t* info, void* context)
log_err(filepath);
}
-#if defined(__linux__) || defined(__gnu_hurd__)
+#if defined(__GLIBC__) || defined(__gnu_hurd__)
void* buffer[MAXTRACE];
char** strings;
int n = backtrace(buffer, MAXTRACE);
@@ -617,7 +617,7 @@ signal_handler(int signo, siginfo_t* info, void* context)
log_err(filepath);
}
-#if __linux__
+#if __GLIBC__
ucontext_t* ucontext = (ucontext_t*)context;
/*
filepath[0] = '\0';
@@ -811,7 +811,7 @@ signal_handler(int signo, siginfo_t* info, void* context)
log_err(filepath);
}
-#if __linux__ && (defined(__x86_64__) || defined(__i386__)) && (_BSD_SOURCE || _SVID_SOURCE || _DEFAULT_SOURCE)
+#if __GLIBC__ && (defined(__x86_64__) || defined(__i386__)) && (_BSD_SOURCE || _SVID_SOURCE || _DEFAULT_SOURCE)
// dump more information about the memory address of the error
#define PAGESIZE 4096
#define LINESIZE 32
|