[Mono-list] How to work with Mono.Unix.Signalhandler

Andreas Sliwka Andreas Sliwka <andreas.sliwka@gmail.com>
Wed, 27 Apr 2005 14:49:03 +0200


------=_Part_5989_18578235.1114606143791
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Greetings,
I recently tried to compile tomboy 0.3.2 and found that my mono
1.1.4installation did not like the calls to
Mono.Posix. So I tried to replace them with calls to Mono.Unix.=20
My problem is that I dont find any documentation about=20
Mono.Unix.SignalHandler.

The code I want to to translate is the following:

using Mono.Posix;
class SomeClass {=20
 // ...
static Syscall.sighandler_t sig_handler;
static void RegisterSignalHandlers () {
sig_handler =3D OnExitSignal;
Syscall.signal ((int) Signals.SIGTERM, sig_handler);
Syscall.signal ((int) Signals.SIGQUIT, sig_handler);
}
 static void OnExitSignal (int signal) {
 // do this and that ...
 }
}

how would I write this with Mono.Unix?

mfg

------=_Part_5989_18578235.1114606143791
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Greetings,<br>&nbsp;&nbsp;I recently tried to compile tomboy 0.3.2 and
found that my mono 1.1.4 installation did not like the calls to
Mono.Posix. So I tried to replace them with calls to Mono.Unix. <br>&nbsp;&=
nbsp;My problem is that I dont find any documentation about Mono.Unix.Signa=
lHandler.<br><br>The code I want to to translate is the following:<br><br>
<span style=3D"font-family: courier new,monospace;">using Mono.Posix;</span=
><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">class SomeClass { </spa=
n><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">&nbsp; // ...</span><br=
 style=3D"font-family: courier new,monospace;"><span style=3D"font-family: =
courier new,monospace;">&nbsp; static Syscall.sighandler_t sig_handler;</sp=
an><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">&nbsp; static void Regi=
sterSignalHandlers () {</span><br style=3D"font-family: courier new,monospa=
ce;"><span style=3D"font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;=
 sig_handler =3D OnExitSignal;
</span><br style=3D"font-family: courier new,monospace;"><span style=3D"fon=
t-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; Syscall.signal ((int) =
Signals.SIGTERM, sig_handler);</span><br style=3D"font-family: courier new,=
monospace;"><span style=3D"font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; Syscall.signal ((int) Signals.SIGQUIT, sig_handler);</sp=
an><br style=3D"font-family: courier new,monospace;"><span style=3D"font-fa=
mily: courier new,monospace;">&nbsp; }</span><br style=3D"font-family: cour=
ier new,monospace;">
<span style=3D"font-family: courier new,monospace;">&nbsp; static void OnEx=
itSignal (int signal) {</span><br style=3D"font-family: courier new,monospa=
ce;">
<span style=3D"font-family: courier new,monospace;">&nbsp; &nbsp; // do thi=
s and that ...</span><br style=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">&nbsp; }</span><br styl=
e=3D"font-family: courier new,monospace;">
<span style=3D"font-family: courier new,monospace;">}</span><br style=3D"fo=
nt-family: courier new,monospace;">
<br style=3D"font-family: courier new,monospace;">
how would I write this with Mono.Unix?<br>
<br>
mfg<br>
------=_Part_5989_18578235.1114606143791--