Function SDL_CreateProcessWithProperties
pub unsafe extern "C" fn SDL_CreateProcessWithProperties(
props: u32,
) -> *mut SDL_Process
Available on crate feature
dep_sdl3
only.Expand description
Create a new process with the specified properties.
These are the supported properties:
SDL_PROP_PROCESS_CREATE_ARGS_POINTER
: an array of strings containing the program to run, any arguments, and a NULL pointer, e.g. const char *args[] = { “myprogram”, “argument”, NULL }. This is a required property.SDL_PROP_PROCESS_CREATE_ENVIRONMENT_POINTER
: anSDL_Environment
pointer. If this property is set, it will be the entire environment for the process, otherwise the current environment is used.SDL_PROP_PROCESS_CREATE_STDIN_NUMBER
: anSDL_ProcessIO
value describing where standard input for the process comes from, defaults toSDL_PROCESS_STDIO_NULL
.SDL_PROP_PROCESS_CREATE_STDIN_POINTER
: anSDL_IOStream
pointer used for standard input whenSDL_PROP_PROCESS_CREATE_STDIN_NUMBER
is set toSDL_PROCESS_STDIO_REDIRECT
.SDL_PROP_PROCESS_CREATE_STDOUT_NUMBER
: anSDL_ProcessIO
value describing where standard output for the process goes to, defaults toSDL_PROCESS_STDIO_INHERITED
.SDL_PROP_PROCESS_CREATE_STDOUT_POINTER
: anSDL_IOStream
pointer used for standard output whenSDL_PROP_PROCESS_CREATE_STDOUT_NUMBER
is set toSDL_PROCESS_STDIO_REDIRECT
.SDL_PROP_PROCESS_CREATE_STDERR_NUMBER
: anSDL_ProcessIO
value describing where standard error for the process goes to, defaults toSDL_PROCESS_STDIO_INHERITED
.SDL_PROP_PROCESS_CREATE_STDERR_POINTER
: anSDL_IOStream
pointer used for standard error whenSDL_PROP_PROCESS_CREATE_STDERR_NUMBER
is set toSDL_PROCESS_STDIO_REDIRECT
.SDL_PROP_PROCESS_CREATE_STDERR_TO_STDOUT_BOOLEAN
: true if the error output of the process should be redirected into the standard output of the process. This property has no effect ifSDL_PROP_PROCESS_CREATE_STDERR_NUMBER
is set.SDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEAN
: true if the process should run in the background. In this case the default input and output isSDL_PROCESS_STDIO_NULL
and the exitcode of the process is not available, and will always be 0.
On POSIX platforms, wait() and waitpid(-1, …) should not be called, and
SIGCHLD should not be ignored or handled because those would prevent SDL
from properly tracking the lifetime of the underlying process. You should
use SDL_WaitProcess()
instead.
§Parameters
props
: the properties to use.
§Return value
Returns the newly created and running process, or NULL if the process couldn’t be created.
§Thread safety
It is safe to call this function from any thread.
§Availability
This function is available since SDL 3.2.0.