Psigintr()

LONG Psigintr( vec, sig )

WORD vec;
WORD sig;
Psigintr() assigns a signal to a particular exception vector. When the exception occurs, the kernel will send the signal to the process.
Opcode318 (0x013e)
AvailabilityAvailable when a 'MiNT' cookie with a version of at least 1.11 exists.
Parametersvec specifies the exception vector. This is the same value as specified for Setexc() call.

sig specifies the signal number that is supposed to be delivered when an exception assigned to the vector vec occurs.

Binding
move.w	sig,-(sp)
move.w	vec,-(sp)
move.w	#$013e,-(sp)
trap	#1
addq.l	#6,sp
Return ValuePsigintr() returns the old value of the vector vec on success. Otherwise two fixed values are defined:

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.

CaveatsYou 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.
CommentsIt 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()