mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Backtracing][Linux] Include declarations for gettid() and tgkill().
Older glibc doesn't include these. Nor does Musl, it seems. The previous fix put the gettid() declaration too far down the file. rdar://110417355
This commit is contained in:
@@ -183,6 +183,18 @@ _swift_installCrashHandler()
|
||||
|
||||
namespace {
|
||||
|
||||
// Older glibc and musl don't have these two syscalls
|
||||
pid_t
|
||||
gettid()
|
||||
{
|
||||
return (pid_t)syscall(SYS_gettid);
|
||||
}
|
||||
|
||||
int
|
||||
tgkill(int tgid, int tid, int sig) {
|
||||
return syscall(SYS_tgkill, tgid, tid, sig);
|
||||
}
|
||||
|
||||
void
|
||||
reset_signal(int signum)
|
||||
{
|
||||
@@ -296,12 +308,6 @@ getdents(int fd, void *buf, size_t bufsiz)
|
||||
return syscall(SYS_getdents64, fd, buf, bufsiz);
|
||||
}
|
||||
|
||||
pid_t
|
||||
gettid()
|
||||
{
|
||||
return (pid_t)syscall(SYS_gettid);
|
||||
}
|
||||
|
||||
/* Stop all other threads in this process; we do this by establishing a
|
||||
signal handler for SIGPROF, then iterating through the threads sending
|
||||
SIGPROF.
|
||||
|
||||
Reference in New Issue
Block a user