SDL_GetProcessProperties(3)

πŸ’– SDL_GetProcessProperties β€” the SDL3 functions glow-up πŸ’–

okay so bestie, we're in the SDL_GetProcessProperties(3) page and it's giving "let me peek at what my lil process is actually made of" ✨


🌸 NAME 🌸

SDL_GetProcessProperties β€” grab the properties that are tied to a process, no cap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_process.h>

SDL_PropertiesID SDL_GetProcessProperties(SDL_Process *process);

πŸ¦‹ DESCRIPTION πŸ¦‹

so SDL is literally handing you these read-only properties, and you're not allowed to touch them, only admire them πŸ’…:

  • SDL_PROP_PROCESS_PID_NUMBER β€” the process ID of the process. yes bestie, the whole point of a process ID, iconic.
  • SDL_PROP_PROCESS_STDIN_POINTER β€” an SDL_IOStream you can use to write input into the process, but only if it was created with SDL_PROP_PROCESS_CREATE_STDIN_NUMBER set to SDL_PROCESS_STDIO_APP. conditional queen πŸ™ˆ
  • SDL_PROP_PROCESS_STDOUT_POINTER β€” a non-blocking SDL_IOStream you can use to read output from the process, but only if it was created with SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER set to SDL_PROCESS_STDIO_APP.
  • SDL_PROP_PROCESS_STDERR_POINTER β€” a non-blocking SDL_IOStream you can use to read the error output from the process, but only if it was created with SDL_PROP_PROCESS_CREATE_STDERR_NUMBER set to SDL_PROCESS_STDIO_APP. yes, the drama channel of your process πŸ’€
  • SDL_PROP_PROCESS_BACKGROUND_BOOLEAN β€” true if the process is running in the background. main character but off-screen, honestly.
fr fr, all of these are read-only. look, don't touch.

🌈 FUNCTION PARAMETERS 🌈

  • process β€” the process you want to query, aka the one we're being nosy about πŸ‘€

⭐ RETURN VALUE ⭐

returns a valid property ID on success, or 0 on failure. and if it fails? call SDL_GetError() for more info, she'll tell you what went wrong 😭


πŸ’œ THREAD SAFETY πŸ’œ

it is safe to call this function from any thread. multi-threaded baddies, this one's for you 🧚


πŸ‘‘ AVAILABILITY πŸ‘‘

this function is available since SDL 3.2.0. vintage-ish but still fresh ✨


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie, you ate πŸ“

Simple Directmedia Layer β€’ SDL 3.4.18 β€’ SDL_GetProcessProperties(3) β€” mwah, tysm for reading, ily, go forth and query those processes πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from