SDL_CreateProcess(3)
π SDL_CreateProcess(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today we're spawning a whole new process like it's nothing. this is SDL_CreateProcess, and yes it's exactly as iconic as it sounds π«Ά
β¨ NAME β¨
SDL_CreateProcess β Create a new process.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_process.h>
SDL_Process * SDL_CreateProcess(const char * const *args, bool pipe_stdio);
π¦ DESCRIPTION π¦
so like, the path to the executable you wanna run? that goes in args[0]. then args[1..N] are the extra arguments that get passed on the command line of the new process, and β this is the important part, don't forget it β the argument list has to be terminated with a NULL. no cap. like this:
const char *args[] = { "myprogram", "argument", NULL };
now, setting pipe_stdio to true? that's literally equivalent to setting SDL_PROP_PROCESS_CREATE_STDIN_NUMBER and SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER to SDL_PROCESS_STDIO_APP, and it's what lets you use SDL_ReadProcess() or SDL_GetProcessInput() and SDL_GetProcessOutput(). the way that just works π
if you want the full tea, go read SDL_CreateProcessWithProperties() β it has more details.
π FUNCTION PARAMETERS π
argsβ the path and arguments for the new process.pipe_stdioβtrueto create pipes to the process's standard input and from the process's standard output;falsefor the process to have no input and inherit the application's standard output.
π RETURN VALUE π
Returns the newly created and running process, or NULL if the process couldn't be created. so if you get NULL, it's giving "couldn't make it happen" π
π₯ THREAD SAFETY π₯
It is safe to call this function from any thread. go off, multithreaded queen β¨
π AVAILABILITY π
This function is available since SDL 3.2.0.
π SEE ALSO π
SDL_CreateProcessWithProperties(3)SDL_GetProcessProperties(3)SDL_ReadProcess(3)SDL_GetProcessInput(3)SDL_GetProcessOutput(3)SDL_KillProcess(3)SDL_WaitProcess(3)SDL_DestroyProcess(3)
and that's the whole page, bestie, you ate that π this little love letter came to you from Simple Directmedia Layer, running the SDL 3.4.18 era, and it's the SDL_CreateProcess(3) page. mwah π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms