SysProcWaitFor

Table of Contents

SysProcWaitFor

Description

Block the parent process and wait for provided child process to finish execution. This will wait for given time, otherwise will continue execution to parent without closing the child process. Parent may then call terminate if they need the process to end.

Parameters

NameDirectionDescription
procinChild process handle to wait for.
timeoutinTimeout in milliseconds, 0 for infinite wait.

Success

Return

Failure

Abort with log message.

Usage example (Cross-references)

    }
    
    SysProcStatus SysProcWaitFor(SysProc *proc, u64 timeout_ms) {
    if (!proc) {
    LOG_FATAL("Invalid arguments");
    
    // wait for program to exit for 1 second
    SysProcWaitFor(proc, 1000);
    
    // finally terminate

Share :