[Overview][Constants][Types][Procedures and functions] | Reference for unit 'BaseUnix' (#rtl) |
Install signal handler (deprecated)
Source position: bunxovlh.inc line 48
function FpSignal( |
signum: LongInt; |
Handler: signalhandler |
FPSignal installs a new signal handler (specified by Handler) for signal SigNum.
This call has a subset of the functionality provided by the FpSigAction call. The return value for FpSignal is the old signal handler, or nil on error.
Extended error information can be retrieved using fpGetErrno.
|
Install signal handler |
|
|
Send a signal to a process |
Program example58; { Program to demonstrate the Signal function.} { do a kill -USR1 pid from another terminal to see what happens. replace pid with the real pid of this program. You can get this pid by running 'ps'. } uses BaseUnix; Procedure DoSig(sig : cint);cdecl; begin writeln('Receiving signal: ',sig); end; begin if fpSignal(SigUsr1,SignalHandler(@DoSig))=signalhandler(SIG_ERR) then begin writeln('Error: ',fpGetErrno,'.'); halt(1); end; Writeln ('Send USR1 signal or press <ENTER> to exit'); readln; end.
No notes exist for this page yet.