LONG Psigintr( vec, sig )
|Psigintr() assigns a signal to a particular exception vector. When the exception occurs, the kernel will send the signal to the process.|
|Availability||Available when a 'MiNT' cookie with a version of at least 1.11 exists.|
|Parameters||vec specifies the
exception vector. This is the same value as specified for
sig specifies the signal number that is supposed to be delivered when an exception assigned to the vector vec occurs.
move.w sig,-(sp) move.w vec,-(sp) move.w #$013e,-(sp) trap #1 addq.l #6,sp
|Return Value||Psigintr() returns the old
value of the vector vec on success. Otherwise two fixed values
E_OK - the SIGNULL was specified as sig parameter (which is ignored).
ENSMEM - the kernel ran out of memory while trying to allocate RAM for internal structures needed by this call.
|Caveats||You should install a signal handler prior to making this call, otherwise your process will most probably get killed by a first interrupt assigned to vec vector.|
|Comments||It seems that there's currently no way
to remove the installed handler completely, unless you restore the
vec using Setexc(). This however doesn't deallocate the
memory taken by a previous Psigintr() call. So the correct
approach would be to call Psigintr() once, then, if a temporary
removal of the signal handler is required, mask the signal out using
Psigsetmask() or Psigblock().
The handler set up by Psigintr() gets removed when your process terminates.
|See Also||Pause(), Pkill(), Psigsetmask(), Psignal()|