From 9328beec56caa104304d16547c724ebb7df5fb69 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 23 Aug 2024 16:36:31 +1200 Subject: [PATCH] Use `syscall(SYS_gettid)` because `gettid()` is only in new-ish glibc --- src/ContextSwitchEvent.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ContextSwitchEvent.cc b/src/ContextSwitchEvent.cc index 541ca0184d0..4eb45e69a12 100644 --- a/src/ContextSwitchEvent.cc +++ b/src/ContextSwitchEvent.cc @@ -73,7 +73,7 @@ static bool can_use_switch_records() { } struct f_owner_ex own; own.type = F_OWNER_TID; - own.pid = gettid(); + own.pid = syscall(SYS_gettid); ret = fcntl(fd, F_SETOWN_EX, &own); if (ret < 0) { FATAL() << "Failed to fcntl(SETOWN_EX)";