Skip to content

Commit 92fe6c4

Browse files
committed
Fix alpine build
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
1 parent dbeb004 commit 92fe6c4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tracer/live_debugger.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ void dd_start_debugger_timeout(void) {
6262
DDTRACE_G(capture_deadline_ns) = now_ns + (uint64_t)ms * 1000000ULL;
6363
DDTRACE_G(debugger_capture_timed_out) = 0;
6464
#ifdef __linux__
65+
// musl exposes it, but glibc doesn't always. Define the glibc variant here.
66+
#ifndef sigev_notify_thread_id
67+
#define sigev_notify_thread_id _sigev_un._tid
68+
#endif
6569
struct sigevent sev = {0};
6670
sev.sigev_notify = SIGEV_THREAD_ID;
6771
sev.sigev_signo = SIGVTALRM;
68-
sev._sigev_un._tid = (pid_t)syscall(SYS_gettid); // gettid() is glibc 2.30 only
72+
sev.sigev_notify_thread_id = (pid_t)syscall(SYS_gettid); // gettid() is glibc 2.30 only
6973
if (timer_create(CLOCK_THREAD_CPUTIME_ID, &sev, &DDTRACE_G(capture_timer)) == 0) {
7074
struct itimerspec it = {
7175
.it_value = { .tv_sec = ms / 1000, .tv_nsec = (ms % 1000) * 1000000LL },

0 commit comments

Comments
 (0)