简体   繁体   中英

where is the “kill” function that sent signal in mingw?

I compiled my code with mingw in windows xp. I want to sent SIGINT signal to child thread.But the header file of "signal.h" don't include "kill" function. The function raise(SIGINT) will finish the program.I have to use kill(pid,SIGINT) to work.But no function.

看看Win32函数TerminateProcess

The kill function is part of the c stardard library and represents a system call, which send a specified signal to the targeted process. As you use mingw, it don't use the glibc library, but gnulib instead to compile, so you should check the corresponding gnulib function.

mingw does not support kill on windows. You can use SendMessage to the window of the other thread and let it handle it and die gracefully. For non-windowed apps use events (CreateEvent / WaitForSingleObject) as a communication mechanism with the 'child' threads.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM