Function SDL_ReadProcess
pub unsafe extern "C" fn SDL_ReadProcess(
process: *mut SDL_Process,
datasize: *mut usize,
exitcode: *mut i32,
) -> *mut c_void
Available on crate feature
dep_sdl3
only.Expand description
Read all the output from a process.
If a process was created with I/O enabled, you can use this function to read the output. This function blocks until the process is complete, capturing all output, and providing the process exit code.
The data is allocated with a zero byte at the end (null terminated) for
convenience. This extra byte is not included in the value reported via
datasize
.
The data should be freed with SDL_free()
.
§Parameters
process
: The process to read.datasize
: a pointer filled in with the number of bytes read, may be NULL.exitcode
: a pointer filled in with the process exit code if the process has exited, may be NULL.
§Return value
Returns the data or NULL on failure; call SDL_GetError()
for more
information.
§Thread safety
This function is not thread safe.
§Availability
This function is available since SDL 3.2.0.