[fpc-pascal] sending signal to child process

Henry Vermaak henry.vermaak at gmail.com
Mon Mar 30 16:36:41 CEST 2009

2009/3/30 Tom Carly <tom.carly at commsquare.com>:
> Hi,
> I have a process A that starts another process B (with TProcess.Create).
> I introduced signal handling for SIGHUP, SIGTERM and SIGINT in process A and
> process B.
> The signal handling of process A triggers a call to
> “fpkill(processA.processid, SIGTERM)” (or “processA.Terminate(0)”).

do you mean processB.processid here?

> This code is executed when killing process A.
> The problem is that the signal handling code of process B is not executed
> when killing process A (although process B does get killed).
> If I launch process B separately and kill it, then the signal handling code
> of process B is executed. It seems that the signal that is sent from process
> A to process B is not the same as when you kill it via the command line.

are the permissions the same for the two processes?  are you sending
sigterm from the commandline, too?

i've done something similar before, but using a different signal.
that shouldn't matter, since sigterm can be blocked (unlike sigkill
and sigstop).


More information about the fpc-pascal mailing list