Skip to main content

SDL_WaitProcess

Function SDL_WaitProcess 

Source
pub unsafe extern "C" fn SDL_WaitProcess(
    process: *mut SDL_Process,
    block: bool,
    exitcode: *mut c_int,
) -> bool
Expand description

Wait for a process to finish.

This can be called multiple times to get the status of a process.

The exit code will be the exit code of the process if it terminates normally, a negative signal if it terminated due to a signal, or -255 otherwise. It will not be changed if the process is still running.

If you create a process with standard output piped to the application (pipe_stdio being true) then you should read all of the process output before calling SDL_WaitProcess(). If you don’t do this the process might be blocked indefinitely waiting for output to be read and SDL_WaitProcess() will never return true;

Parameter: process The process to wait for. Parameter: block If true, block until the process finishes; otherwise, report on the process’ status. Parameter: exitcode a pointer filled in with the process exit code if the process has exited, may be NULL. Returns: true if the process exited, false otherwise.

Thread Safety: This function is not thread safe.

Available Since: This function is available since SDL 3.2.0.

See Also: SDL_CreateProcess See Also: SDL_CreateProcessWithProperties See Also: SDL_KillProcess See Also: SDL_DestroyProcess