-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback on page SDL3/SDL_CreateProcessWithProperties #715
Comments
Also should probably say whether it'll accept shell arguments (I assume not), and whether it'll search the |
@icculus I have found the following info on this:
char** envp = SDL_GetEnvironmentVariables(env); //env is either user passed or current process env Source: https://github.com/libsdl-org/SDL/blob/main/src/process/windows/SDL_windowsprocess.c#L259 Which is basically a copy, so the suggested edit would be something like "an SDL_Environment pointer. If this property is set, it will be the entire environment for the process, otherwise the current environment is used. If a custom environment is passed, it's data is copied during process creation, and therefore, it is still user's responsibility to free it later with SDL_DestroyEnvironment."
Windows: if (!CreateProcessW(NULL, createprocess_cmdline, NULL, NULL, TRUE, creation_flags, createprocess_env, NULL, &startup_info, &data->process_information)) In this case, first argument
The same applies to posix implementation, currently SDL uses if (posix_spawnp(&data->pid, args[0], &fa, &attr, args, envp) != 0) { From man page (https://linux.die.net/man/3/posix_spawnp):
Which means that the search is also performed. So in result, the suggested edit may either contain simple comment like "If not a full path passed to SDL_CreateProcess(), a search in PATH environment variable will be performed", or can be a more extended one mentioning the difference between two platfroms. Although one thing I am confused about is either the PATH variable is taken from parent process environment, or from the one that is passed to
If you are okay with these edits, I can add them to the wiki. |
These should clarify whether the app needs to destroy the
SDL_Environment *
afterwards, likewise for the argument pointer. Does this API copy this data, or take ownership of it?The text was updated successfully, but these errors were encountered: