This function waits for the process specified by PI to finish.

Synopsis

Declared in <llvm/Support/Program.h>

ProcessInfo
Wait(
    ProcessInfo const& PI,
    std::optional<unsigned int> SecondsToWait,
    std::string* ErrMsg = nullptr,
    std::optional<ProcessStatistics>* ProcStat = nullptr,
    bool Polling = false);

Description

  • The process id of the child process if the child process has changed state.

  • 0 if the child process has not changed state.

Note

Users of this function should always check the ReturnCode member of the

Return Value

A

Parameters

Name

Description

PI

The child process that should be waited on.

SecondsToWait

If std::nullopt, waits until child has terminated. If a value, this specifies the amount of time to wait for the child process. If the time expires, and Polling is false, the child is killed and this function returns. If the time expires and Polling is true, the child is resumed. If zero, this function will perform a non‐blocking wait on the child process.

ErrMsg

If non‐zero, provides a pointer to a string instance in which error messages will be returned. If the string is non‐empty upon return an error occurred while invoking the program.

ProcStat

If non‐zero, provides a pointer to a structure in which process execution statistics will be stored.

Polling

If true, do not kill the process on timeout.

See Also

ProcessInfo struct with Pid set to:

ProcessInfo returned from this function.

Created with MrDocs