Using SIGINT

前端 未结 6 1935
误落风尘
误落风尘 2020-12-18 15:24

According to this http://www.cplusplus.com/reference/clibrary/csignal/signal.html

SIGINT is generally used/cause by the user. How do i cause a SIG

6条回答
  •  醉酒成梦
    2020-12-18 16:01

    What other way are you thinking of? The kill() function is the only way the kernel offers to programmatically send a signal.

    Actually, you mentioned you were using Windows. I'm not even sure what kill() does on Windows, since Windows doesn't have the same signal architecture that Unix-derived systems do. Win32 does offer the TerminateProcess function, which may do what you want. There is also the GenerateConsoleCtrlEvent function, which applies to console programs and simulates a Ctrl+C or Ctrl+Break.

提交回复
热议问题