Module process
Available on crate feature
dep_sdl3
only.Expand description
Process control support.
These functions provide a cross-platform way to spawn and manage OS-level processes.
You can create a new subprocess with SDL_CreateProcess()
and optionally
read and write to it using SDL_ReadProcess()
or SDL_GetProcessInput()
and
SDL_GetProcessOutput()
. If more advanced functionality like chaining input
between processes is necessary, you can use
SDL_CreateProcessWithProperties()
.
You can get the status of a created process with SDL_WaitProcess()
, or
terminate the process with SDL_KillProcess()
.
Don’t forget to call SDL_DestroyProcess()
to clean up, whether the process
process was killed, terminated on its own, or is still running!
Structs§
- SDL_
Process - An opaque handle representing a system process.
- SDL_
ProcessIO - Description of where standard I/O should be directed when creating a process.
Constants§
- SDL_
PROCESS_ STDIO_ APP - The I/O stream is connected to a new
SDL_IOStream
that the application can read or write - SDL_
PROCESS_ STDIO_ INHERITED - The I/O stream is inherited from the application.
- SDL_
PROCESS_ STDIO_ NULL - The I/O stream is ignored.
- SDL_
PROCESS_ STDIO_ REDIRECT - The I/O stream is redirected to an existing
SDL_IOStream
. - SDL_
PROP_ PROCESS_ BACKGROUND_ BOOLEAN - SDL_
PROP_ PROCESS_ CREATE_ ARGS_ POINTER - SDL_
PROP_ PROCESS_ CREATE_ BACKGROUND_ BOOLEAN - SDL_
PROP_ PROCESS_ CREATE_ ENVIRONMENT_ POINTER - SDL_
PROP_ PROCESS_ CREATE_ STDERR_ NUMBER - SDL_
PROP_ PROCESS_ CREATE_ STDERR_ POINTER - SDL_
PROP_ PROCESS_ CREATE_ STDERR_ TO_ STDOUT_ BOOLEAN - SDL_
PROP_ PROCESS_ CREATE_ STDIN_ NUMBER - SDL_
PROP_ PROCESS_ CREATE_ STDIN_ POINTER - SDL_
PROP_ PROCESS_ CREATE_ STDOUT_ NUMBER - SDL_
PROP_ PROCESS_ CREATE_ STDOUT_ POINTER - SDL_
PROP_ PROCESS_ PID_ NUMBER - SDL_
PROP_ PROCESS_ STDERR_ POINTER - SDL_
PROP_ PROCESS_ STDIN_ POINTER - SDL_
PROP_ PROCESS_ STDOUT_ POINTER
Functions§
- SDL_
Create ⚠Process - Create a new process.
- SDL_
Create ⚠Process With Properties - Create a new process with the specified properties.
- SDL_
Destroy ⚠Process - Destroy a previously created process object.
- SDL_
GetProcess ⚠Input - Get the
SDL_IOStream
associated with process standard input. - SDL_
GetProcess ⚠Output - Get the
SDL_IOStream
associated with process standard output. - SDL_
GetProcess ⚠Properties - Get the properties associated with a process.
- SDL_
Kill ⚠Process - Stop a process.
- SDL_
Read ⚠Process - Read all the output from a process.
- SDL_
Wait ⚠Process - Wait for a process to finish.