How can I make this program survive when receiving SIGUSR1 signal? I know in C, this can be done because SIGUSR is non-fatal signal. Right now, yes it can detect SIGINT as intended, but sending a SIGUSR1 kills it.
using System;
using Mono.Unix;
using Mono.Unix.Native;
using System.Threading;
namespace testapp {
class MainClass {
public static void Main(string[] args) {
while (true) {
UnixSignal signal = new UnixSignal (Signum.SIGINT);
if (signal.WaitOne (Timeout.Infinite, false)) {
// SIGINT generated
Console.WriteLine("got signal");
}
Console.WriteLine("here");
}
}
}
}
The other posting does not really show it.. and i am not interested in delegates i want the above snippet to handle it and the above is the minimal.
In c, to deal this is to put signal handler or IGN