[Mono-dev] Unix Signal in mono

Jonathan Pryor jonpryor at vt.edu
Mon Feb 29 21:33:59 UTC 2016


On Feb 29, 2016, at 8:18 AM, techi eth <techieth at gmail.com> wrote:
> Thanks for quick hint.
> We can receive signal by using signal handler using Mono.Unix.Native.Stdlib.signal.
> I am trying to check possibility of sending signal from one process to another.
> 
> Example : If i have two process (P1 & P2) & P1 want to send SIGTERM to P2.

Don’t use Stdlib.signal() to setup signal handlers. It’s [Obsolete] because it isn’t signal safe, i.e. it isn’t safe to invoke managed code from within a signal handler.

Instead, to receive a notification of signal delivery, you should use UnixSignal:

	http://www.jprl.com/Blog/archive/development/mono/2008/Feb-08.html
	http://docs.go-mono.com/?link=T%3aMono.Unix.UnixSignal
	https://gist.github.com/jonpryor/1555261

To *send* a signal, use Syscall.kill().

 - Jon



More information about the Mono-devel-list mailing list