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. As of MiNT version 1.15.1 this call is available only on machines equipped with 68020 processor or newer.
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. When both sig and vec are zero, all handlers installed by your program are removed.
Binding
move.w	#sig,-(sp)
move.w	#vec,-(sp)
move.w	#$013e,-(sp)
trap	#1
addq.l	#6,sp
Return ValuePsigintr() returns E_OK on success, or a negative GEMDOS error code otherwise:

EBADARG, a signal or vector number was specified outside the allowed range. Only autovectors ($60-$7c), traps ($80-$bc) and user defined interrupts ($0100-$03fc) are allowed (other interrupts already generate fixed signals).

ENOMEM, the kernel ran out of memory while trying to allocate RAM for internal structures needed by this call.

ENXIO, the interrupt you want to register has no service routine installed.

ENOSYS, the function is not available (wrong architecture).

CaveatsYou should install a signal handler prior to making this call, otherwise your process will most probably get killed by the first occurrance of the interrupt assigned to vec vector.

Also notice that the function is not available on machines equipped with 68000 and 68010 processors.

CommentsThis function has been totally rewritten as of MiNT version 1.15.1. However, the only change visible to programs is that the old value of vec is no longer returned (it had little use anyway). Also, since long stack frames are needed, a 68020 or newer processor is required.

The handler set up by Psigintr() gets removed when your process terminates.

See Also Pause(), Pkill(), Psigsetmask(), Psignal()