Quantcast

kill signal

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

kill signal

Jennifer Lai
Hi,
    Is there any equivalent function call to UNIX kill( ) in mingw?

Thanks,
Jennifer



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: kill signal

Jeremy Bettis
---- Original Message -----
From: "Jennifer Lai" <[hidden email]>
>    Is there any equivalent function call to UNIX kill( ) in mingw?

TerminateProcess() from the WinAPI.  Or if you just wanted to send a signal
instead of actually killing the process, I usually use SendMessage for that.



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: kill signal

Aaron W. LaFramboise-2
In reply to this post by Jennifer Lai
Jennifer Lai wrote:

>     Is there any equivalent function call to UNIX kill( ) in mingw?

Also note the standard C function raise(), which handles a subset of
kill()'s functionality.

The closest general concept to POSIX's interrupt-like signals, besides
what standard C provides, are SEH exceptions, which are triggered by
things like int3, invalid memory accesses, signaling floating point
exceptions, and RaiseException().  Unfortunately, theres no particular
way to raise an arbitrary signal in another process.

There is also a signal-like interface for handling Ctrl-C and Ctrl-Break
events as part of the console API, using GenerateConsoleCtrlEvent and
SetConsoleCtrlHandler.

If you just want to make some Unix application compile, consider
providing a very simple implementation of kill() that calls raise if pid
== _getpid(), otherwise fails.  This will probably work for most purposes.

Between these interfaces and the ones Jeremy Bettis mentions, you should
be able to find something that will satisfy your need.


Aaron W. LaFramboise



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Loading...