ProcTerminate
Description
Terminate the child process. Sends SIGTERM on POSIX (giving the child a chance to clean up before exiting), calls TerminateProcess on Windows.
Success
Returns to the caller. The child has been signalled (the kernel reaps it asynchronously; pair with ProcWait if you need the exit status).
Failure
Returns to the caller. Any kill error is logged but not surfaced; this call is best-effort.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Proc.c:386:
}
void ProcTerminate(Proc *proc) {
if (!proc) {
LOG_FATAL("Invalid argument");- In
Proc.c:449:
// child-side cleanup; we always zero-and-return at the end.
if (ProcOk(proc)) {
ProcTerminate(proc);
#if PLATFORM_UNIX
direct_sys1(MISRA_SYS_close, (long)(proc->_stdin_fd));
Last updated on