Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FilePause()Pkill()Psigsetmask()Psignal()Psigintr() GEMDOSSyntaxLONG Psigintr( vec, sig )
WORD vec;
WORD sig;
Function Psigintr() assigns a signal to a particular exception vector.
When the exception occurs, the kernel will send the signal
to the process.
Opcode 318 (0x013e)
Availability Available when a 'MiNT' cookie with a version of at least
1.11 exists.
Parametres 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 Value Psigintr() 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.
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()