Skip to content

Commit

Permalink
fix compilation with glibc version <= 2.30
Browse files Browse the repository at this point in the history
  • Loading branch information
kin4stat authored Apr 30, 2023
1 parent bdba30e commit 910feaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/kthook/x86_64/kthook_x86_64_detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ inline bool freeze_threads(frozen_threads& threads) {
}

auto self_pid = getpid();
auto self_tid = gettid();
auto self_tid = syscall(sys_gettid);

for (const auto& dir_entry : std::filesystem::directory_iterator{"/proc/self/task"}) {
if (dir_entry.is_directory()) {
Expand All @@ -794,7 +794,7 @@ inline bool freeze_threads(frozen_threads& threads) {
std::from_chars(tid_str.c_str(), tid_str.c_str() + tid_str.size(), tid);

if (tid != self_tid) {
tgkill(self_pid, tid, SIGUSR1);
syscall(sys_tgkill, self_pid, tid, SIGUSR1);
threads.thread_ids.push_back(tid);
}
}
Expand All @@ -820,7 +820,7 @@ inline bool unfreeze_threads(frozen_threads& threads) {
auto self_pid = getpid();

for (auto tid : threads.thread_ids) {
tgkill(self_pid, tid, SIGUSR2);
syscall(sys_tgkill, self_pid, tid, SIGUSR2);
}

sigaction(SIGUSR1, &threads.oldact1, nullptr);
Expand Down

0 comments on commit 910feaf

Please sign in to comment.