HyperDbg Debugger
Loading...
Searching...
No Matches
platform-signal.c File Reference

User mode cross-platform implementation of the console-control handler. More...

#include "pch.h"

Detailed Description

User mode cross-platform implementation of the console-control handler.

Author
Max Raulea (max.r.nosp@m.aule.nosp@m.a@gma.nosp@m.il.c.nosp@m.om)

See platform-signal.h. The Windows branch forwards to SetConsoleCtrlHandler. The Linux branch blocks the handled signals and dispatches them from a dedicated sigwait() thread. sigwait() (rather than a sigaction() handler) is used deliberately: BreakController calls ShowMessages (printf), socket I/O and Sleep, none of which are async-signal-safe. Running the handler on a normal thread woken by sigwait() sidesteps that entirely and mirrors the Windows model where the console-control handler also runs on its own thread.

Version
0.20
Date
2026-06-16