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-FilePsigreturn()Psigblock()Pkill()Psignal() GEMDOSSyntaxLONG Psignal( sig, handler )
WORD sig;
VOID (*handler)( LONG );
Function Psignal() determines the action taken when a signal is
received by the process.
Opcode 274 (0x112)
Availability This function is available under all MiNTversions integrated with MultiTOS.
Parameters sig specifies the signal whose response you wish to modify.
If handler is cast to SIG_DFL (0) then the default action
for the signal will occur when received. If handler is cast
to SIG_IGN (1) then the signal will be ignored by the
process. Otherwise, handler points to a user function which
is designed to take action on a signal. This function is
called when a signal is received with a LONG signal number
on the stack.
Binding pea handler
move.w sig,-(sp)
move.w #$112,-(sp)
trap #1
addq.l #8,sp
Return Value Psignal() returns the old value of the signal handler if
successful or a negative GEMDOS error code otherwise.
Comments Signal handler functions may make any GEMDOS, BIOS, or XBIOS calls desired but must not make any AES or VDI calls. Signal
handlers must either return with a 680x0 RTS instruction to
resume program execution or call Psigreturn() to clean the
stack if it intends to do a 'C' longjmp(). Signal handling is
preserved across Pfork() and Pvfork() calls. Child processes started with Pexec() ignore and follow the default action
the same as their parents. Signals which have user functions
assigned to them are reset to the default action for child
processes.
See Also Psigreturn(), Psigblock(), Pkill()