On Windows, the CTRL_C_EVENT and CTRL_BREAK_EVENT control signals are converted to
SIGINT in the runtime package for Windows for use by the os/signal package. After some
investigation, I believe CTRL_CLOSE_EVENT should be emulated as SIGHUP. SIGHUP is
already invented for compatibility purposes in the syscall package, in the same way that
SIGINT is, and then actively used by the existing handlers installed for CTRL_C_EVENT
and CTRL_BREAK_EVENT above.
Relevant lines in tip's source:
runtime·stdcall(runtime·SetConsoleCtrlHandler, 2, runtime·ctrlhandler, (uintptr)1);
// This registers Go's control event handler to convert control events into unix-like
signals
/* in the handler these events are converted to SIGINT */
case CTRL_C_EVENT:
case CTRL_BREAK_EVENT:
s = SIGINT;
/* invented values for important signals */
SIGHUP = Signal(0x1)
SIGINT = Signal(0x2)
Please also see:
http://stackoverflow.com/q/20511182/149482http://msdn.microsoft.com/en-us/library/windows/desktop/ms685049%28v=vs.85%29.aspxhttp://msdn.microsoft.com/en-us/library/windows/desktop/ms683242(v=vs.85).aspx
The text was updated successfully, but these errors were encountered:
I implemented the required changes in the Go code base and verified it works. If there
is interest in this fix I can submit a proper patch via Rietveld.
The text was updated successfully, but these errors were encountered: