SDL_ProcessIO(3type)
π SDL_ProcessIO π
okay bestie, welcome to the SDL3 DATATYPES corner of the man pages πΈ this one's called SDL_ProcessIO, and it's literally the glow-up guide for where your process's standard I/O goes when you spin one up. no cap.
β¨ NAME β¨
SDL_ProcessIO β a whole description of where standard I/O should be directed when creating a process. that's it, that's the vibe π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_process.h>
typedef enum SDL_ProcessIO
{
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_APP, /**< The I/O stream is connected to a new SDL_IOStream that the application can read or write */
SDL_PROCESS_STDIO_REDIRECT /**< The I/O stream is redirected to an existing SDL_IOStream. */
} SDL_ProcessIO;
look at her. four little enum girlies, each one with main character energy π
π DESCRIPTION π
so here's the tea, one stream at a time β
SDL_PROCESS_STDIO_INHERITEDβ the I/O stream goes to the exact same place as the application's own I/O stream. sharing is caring fr fr. this is the default for standard output and standard error πSDL_PROCESS_STDIO_NULLβ the stream gets yeeted into the void π³οΈ it's connected toNUL:on Windows and/dev/nullon POSIX systems. this is the default for standard input. stream said "not me participating" πSDL_PROCESS_STDIO_APPβ the stream is connected to a brand newSDL_IOStreamthat your application can actually get its hands on π and each one has its own lil home:- standard input shows up as
SDL_PROP_PROCESS_STDIN_POINTER, and it lets you useSDL_GetProcessInput() - standard output shows up as
SDL_PROP_PROCESS_STDOUT_POINTER, and it lets you useSDL_ReadProcess()andSDL_GetProcessOutput() - standard error shows up as
SDL_PROP_PROCESS_STDERR_POINTER - all three of those live in the properties for the created process π«Ά
- standard input shows up as
SDL_PROCESS_STDIO_REDIRECTβ the stream gets connected to an existingSDL_IOStreamthat your application provides. here's how each one gets handed over, all in the creation properties:- standard input is provided using
SDL_PROP_PROCESS_CREATE_STDIN_POINTER - standard output is provided using
SDL_PROP_PROCESS_CREATE_STDOUT_POINTER - standard error is provided using
SDL_PROP_PROCESS_CREATE_STDERR_POINTER
- standard input is provided using
β οΈ bestie listen. those existing streams should be closed by the application once the new process is created. don't just leave them hanging, that's messy π
and one more tiny-but-huge detail for the redirect girlies:
π in order to use anSDL_IOStreamwithSDL_PROCESS_STDIO_REDIRECT, it must haveSDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTERorSDL_PROP_IOSTREAM_FILE_DESCRIPTOR_NUMBERset. good news tho β this is true for streams representing files and process I/O, so you're probably already slaying β¨
π AVAILABILITY π
this enum has been available since SDL 3.2.0. she's not new new, but she ate and left no crumbs π
π SEE ALSO π
go read these next, they're all in the group chat together:
SDL_CreateProcessWithProperties(3)SDL_GetProcessProperties(3)SDL_ReadProcess(3)SDL_GetProcessInput(3)SDL_GetProcessOutput(3)
okay that's the whole page, you're basically a process I/O expert now π§β¨ this lil cutie came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 π thanks for reading bestie, go forth and spawn responsibly π«Ά
π¦ 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