Skip to content

Commit 77de53b

Browse files
committed
[Backtracing][Linux] Use syscall() to call gettid().
Older versions of Linux don't have gettid() in their headers, so use syscall() to call it instead. rdar://110417355
1 parent 97e6b56 commit 77de53b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/runtime/CrashHandlerLinux.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ getdents(int fd, void *buf, size_t bufsiz)
296296
return syscall(SYS_getdents64, fd, buf, bufsiz);
297297
}
298298

299+
pid_t
300+
gettid()
301+
{
302+
return (pid_t)syscall(SYS_gettid);
303+
}
304+
299305
/* Stop all other threads in this process; we do this by establishing a
300306
signal handler for SIGPROF, then iterating through the threads sending
301307
SIGPROF.

0 commit comments

Comments
 (0)