You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please consider adding a "SDL_GetCurrentProcessId()" and "SDL_GetCurrentProcessName()" implementation.
SDL_GetCurrentProcessId would return the current pid
SDL_GetCurrentProcessName would return the executable name
Both should be cached, since they're static, with the second maybe saved alongside the current executable path.
Alternative:
GetCurrentProcess returning a SDL_Process structure with the properties being the current pid and a new property being the process name (SDL.process.name)
Obviously, I can imagine this is low-prio compared to other bugs or requests, but it'd be appreciated if you kept it in mind, as since most operating systems are posix-based, it shouldn't be hard to implement cross-platform.
Use cases:
log file to match the exe
maybe monitoring the current process via the id
some files with local config files that match the exe for games that allow modding (and would duplicate executables)
the current pid might be useful if the current SDL process API will extend to more functions
adding a failsafe in SDL_KillProcess that it should return and fail if the process is the one that is the current process
maybe some games want to verify that users didn't tamper or execute any executables that are not approved by the game (i.e. patched for some cheats and having a separately patched exe so that Steam or other platforms don't overwrite it)
other use cases that don't come to mind atm :)
The text was updated successfully, but these errors were encountered:
thedarknomad
changed the title
[Process] [Request] Identifying current process
[Process] [New Feature] Identifying current process
Mar 22, 2025
Leaving this here; SDL_GetBasePath implementations have code that fetch the path to the running executable seemingly on most platforms (at least Unix and Windows). For the PID, it would be GetCurrentProcessId on Windows and getpid on POSIX.
Indeed. As for consoles and mobile devices maybe the workaround could be using args[0] and stripping it from absolute/relative paths captured from main().
Please consider adding a "SDL_GetCurrentProcessId()" and "SDL_GetCurrentProcessName()" implementation.
Both should be cached, since they're static, with the second maybe saved alongside the current executable path.
Alternative:
Obviously, I can imagine this is low-prio compared to other bugs or requests, but it'd be appreciated if you kept it in mind, as since most operating systems are posix-based, it shouldn't be hard to implement cross-platform.
Use cases:
The text was updated successfully, but these errors were encountered: