| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Process
Contents
Description
Process control support.
These functions provide a cross-platform way to spawn and manage OS-level processes.
You can create a new subprocess with and optionally read and write to it using createProcess or readProcess and getProcessInput. If more advanced functionality like chaining input between processes is necessary, you can use getProcessOutput.createProcessWithProperties
You can get the status of a created process with , or terminate the process with waitProcess.killProcess
Don't forget to call to clean up, whether the process process was killed, terminated on its own, or is still running! An opaque handle representing a system process.destroyProcess
- See also
createProcess
FFI conventions
Unsuffixed aliases are unsafe foreign imports; aliases suffixed Safe are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under SDL3.Sys.Bindgen.Process.Unsafe); functions curated unsafe-only export only the unsuffixed one. Each alias's documentation records its flavor and rationale.
Full conventions: SDL3.Sys.
Since: 3.2.0
Synopsis
- module SDL3.Sys.Bindgen.Process
- createProcess :: PtrConst (PtrConst CChar) -> Bool -> IO (Ptr SDL_Process)
- createProcessSafe :: PtrConst (PtrConst CChar) -> Bool -> IO (Ptr SDL_Process)
- createProcessWithProperties :: SDL_PropertiesID -> IO (Ptr SDL_Process)
- createProcessWithPropertiesSafe :: SDL_PropertiesID -> IO (Ptr SDL_Process)
- getProcessProperties :: Ptr SDL_Process -> IO SDL_PropertiesID
- getProcessPropertiesSafe :: Ptr SDL_Process -> IO SDL_PropertiesID
- readProcess :: Ptr SDL_Process -> Ptr CSize -> Ptr CInt -> IO (Ptr Void)
- readProcessSafe :: Ptr SDL_Process -> Ptr CSize -> Ptr CInt -> IO (Ptr Void)
- getProcessInput :: Ptr SDL_Process -> IO (Ptr SDL_IOStream)
- getProcessInputSafe :: Ptr SDL_Process -> IO (Ptr SDL_IOStream)
- getProcessOutput :: Ptr SDL_Process -> IO (Ptr SDL_IOStream)
- getProcessOutputSafe :: Ptr SDL_Process -> IO (Ptr SDL_IOStream)
- killProcess :: Ptr SDL_Process -> Bool -> IO Bool
- killProcessSafe :: Ptr SDL_Process -> Bool -> IO Bool
- waitProcess :: Ptr SDL_Process -> Bool -> Ptr CInt -> IO Bool
- waitProcessSafe :: Ptr SDL_Process -> Bool -> Ptr CInt -> IO Bool
- destroyProcess :: Ptr SDL_Process -> IO ()
- destroyProcessSafe :: Ptr SDL_Process -> IO ()
Documentation
module SDL3.Sys.Bindgen.Process
Function aliases
Arguments
| :: PtrConst (PtrConst CChar) |
|
| -> Bool |
|
| -> IO (Ptr SDL_Process) |
Create a new process.
The path to the executable is supplied in args[0]. args[1..N] are additional arguments passed on the command line of the new process, and the argument list should be terminated with a NULL, e.g.:
const char *args[] = { "myprogram", "argument", NULL };
Setting pipe_stdio to true is equivalent to setting and sDL_PROP_PROCESS_CREATE_STDIN_NUMBER to sDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_APP, and will allow the use of or readProcess and getProcessInput.getProcessOutput
See for more details.createProcessWithProperties
- 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.
- See also
createProcessWithProperties,getProcessProperties,readProcess,getProcessInput,getProcessOutput,killProcess,waitProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateProcess. The safe flavor iscreateProcessSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CreateProcess, defined atSDL3/SDL_process.h 106:43
Since: 3.2.0
Arguments
| :: PtrConst (PtrConst CChar) |
|
| -> Bool |
|
| -> IO (Ptr SDL_Process) |
Create a new process.
The path to the executable is supplied in args[0]. args[1..N] are additional arguments passed on the command line of the new process, and the argument list should be terminated with a NULL, e.g.:
const char *args[] = { "myprogram", "argument", NULL };
Setting pipe_stdio to true is equivalent to setting and sDL_PROP_PROCESS_CREATE_STDIN_NUMBER to sDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_APP, and will allow the use of or readProcess and getProcessInput.getProcessOutput
See for more details.createProcessWithProperties
- 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.
- See also
createProcessWithProperties,getProcessProperties,readProcess,getProcessInput,getProcessOutput,killProcess,waitProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateProcess. The unsafe flavor iscreateProcess. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CreateProcess, defined atSDL3/SDL_process.h 106:43
Since: 3.2.0
createProcessWithProperties Source #
Arguments
| :: SDL_PropertiesID |
|
| -> IO (Ptr SDL_Process) |
Create a new process with the specified properties.
These are the supported properties:
: 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_ARGS_POINTER: an SDL_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_ENVIRONMENT_POINTER: a UTF-8 encoded string representing the working directory for the process, defaults to the current working directory.sDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING: ansDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_ProcessIOvalue describing where standard input for the process comes from, defaults toSDL_PROCESS_STDIO_NULL.: an SDL_IOStream pointer used for standard input whensDL_PROP_PROCESS_CREATE_STDIN_POINTERis set tosDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_PROCESS_STDIO_REDIRECT.: ansDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_ProcessIOvalue describing where standard output for the process goes to, defaults toSDL_PROCESS_STDIO_INHERITED.: an SDL_IOStream pointer used for standard output whensDL_PROP_PROCESS_CREATE_STDOUT_POINTERis set tosDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_REDIRECT.: ansDL_PROP_PROCESS_CREATE_STDERR_NUMBERSDL_ProcessIOvalue describing where standard error for the process goes to, defaults toSDL_PROCESS_STDIO_INHERITED.: an SDL_IOStream pointer used for standard error whensDL_PROP_PROCESS_CREATE_STDERR_POINTERis set tosDL_PROP_PROCESS_CREATE_STDERR_NUMBERSDL_PROCESS_STDIO_REDIRECT.: 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_TO_STDOUT_BOOLEANis set.sDL_PROP_PROCESS_CREATE_STDERR_NUMBER: true if the process should run in the background. In this case the default input and output issDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEANSDL_PROCESS_STDIO_NULLand the exitcode of the process is not available, and will always be 0.: a string containing the program to run and any parameters. This string is passed directly tosDL_PROP_PROCESS_CREATE_CMDLINE_STRINGCreateProcesson Windows, and does nothing on other platforms. This property is only important if you want to start programs that does non-standard command-line processing, and in most cases usingis sufficient.sDL_PROP_PROCESS_CREATE_ARGS_POINTER
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 instead.waitProcess
- 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.
- See also
createProcess,getProcessProperties,readProcess,getProcessInput,getProcessOutput,killProcess,waitProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateProcessWithProperties. The safe flavor iscreateProcessWithPropertiesSafe. - C declaration
SDL_CreateProcessWithProperties, defined atSDL3/SDL_process.h 227:43
Since: 3.2.0
createProcessWithPropertiesSafe Source #
Arguments
| :: SDL_PropertiesID |
|
| -> IO (Ptr SDL_Process) |
Create a new process with the specified properties.
These are the supported properties:
: 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_ARGS_POINTER: an SDL_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_ENVIRONMENT_POINTER: a UTF-8 encoded string representing the working directory for the process, defaults to the current working directory.sDL_PROP_PROCESS_CREATE_WORKING_DIRECTORY_STRING: ansDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_ProcessIOvalue describing where standard input for the process comes from, defaults toSDL_PROCESS_STDIO_NULL.: an SDL_IOStream pointer used for standard input whensDL_PROP_PROCESS_CREATE_STDIN_POINTERis set tosDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_PROCESS_STDIO_REDIRECT.: ansDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_ProcessIOvalue describing where standard output for the process goes to, defaults toSDL_PROCESS_STDIO_INHERITED.: an SDL_IOStream pointer used for standard output whensDL_PROP_PROCESS_CREATE_STDOUT_POINTERis set tosDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_REDIRECT.: ansDL_PROP_PROCESS_CREATE_STDERR_NUMBERSDL_ProcessIOvalue describing where standard error for the process goes to, defaults toSDL_PROCESS_STDIO_INHERITED.: an SDL_IOStream pointer used for standard error whensDL_PROP_PROCESS_CREATE_STDERR_POINTERis set tosDL_PROP_PROCESS_CREATE_STDERR_NUMBERSDL_PROCESS_STDIO_REDIRECT.: 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_TO_STDOUT_BOOLEANis set.sDL_PROP_PROCESS_CREATE_STDERR_NUMBER: true if the process should run in the background. In this case the default input and output issDL_PROP_PROCESS_CREATE_BACKGROUND_BOOLEANSDL_PROCESS_STDIO_NULLand the exitcode of the process is not available, and will always be 0.: a string containing the program to run and any parameters. This string is passed directly tosDL_PROP_PROCESS_CREATE_CMDLINE_STRINGCreateProcesson Windows, and does nothing on other platforms. This property is only important if you want to start programs that does non-standard command-line processing, and in most cases usingis sufficient.sDL_PROP_PROCESS_CREATE_ARGS_POINTER
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 instead.waitProcess
- 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.
- See also
createProcess,getProcessProperties,readProcess,getProcessInput,getProcessOutput,killProcess,waitProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateProcessWithProperties. The unsafe flavor iscreateProcessWithProperties. - C declaration
SDL_CreateProcessWithProperties, defined atSDL3/SDL_process.h 227:43
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO SDL_PropertiesID |
Get the properties associated with a process.
The following read-only properties are provided by SDL:
: the process ID of the process.sDL_PROP_PROCESS_PID_NUMBER: an SDL_IOStream that can be used to write input to the process, if it was created withsDL_PROP_PROCESS_STDIN_POINTERset tosDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_PROCESS_STDIO_APP.: a non-blocking SDL_IOStream that can be used to read output from the process, if it was created withsDL_PROP_PROCESS_STDOUT_POINTERset tosDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_APP.: a non-blocking SDL_IOStream that can be used to read error output from the process, if it was created withsDL_PROP_PROCESS_STDERR_POINTERset tosDL_PROP_PROCESS_CREATE_STDERR_NUMBERSDL_PROCESS_STDIO_APP.: true if the process is running in the background.sDL_PROP_PROCESS_BACKGROUND_BOOLEAN
- Returns
- a valid property ID on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
createProcess,createProcessWithProperties
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetProcessProperties. The safe flavor isgetProcessPropertiesSafe. - C declaration
SDL_GetProcessProperties, defined atSDL3/SDL_process.h 271:46
Since: 3.2.0
getProcessPropertiesSafe Source #
Arguments
| :: Ptr SDL_Process |
|
| -> IO SDL_PropertiesID |
Get the properties associated with a process.
The following read-only properties are provided by SDL:
: the process ID of the process.sDL_PROP_PROCESS_PID_NUMBER: an SDL_IOStream that can be used to write input to the process, if it was created withsDL_PROP_PROCESS_STDIN_POINTERset tosDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_PROCESS_STDIO_APP.: a non-blocking SDL_IOStream that can be used to read output from the process, if it was created withsDL_PROP_PROCESS_STDOUT_POINTERset tosDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_APP.: a non-blocking SDL_IOStream that can be used to read error output from the process, if it was created withsDL_PROP_PROCESS_STDERR_POINTERset tosDL_PROP_PROCESS_CREATE_STDERR_NUMBERSDL_PROCESS_STDIO_APP.: true if the process is running in the background.sDL_PROP_PROCESS_BACKGROUND_BOOLEAN
- Returns
- a valid property ID on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
createProcess,createProcessWithProperties
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetProcessProperties. The unsafe flavor isgetProcessProperties. - C declaration
SDL_GetProcessProperties, defined atSDL3/SDL_process.h 271:46
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> Ptr CSize |
|
| -> Ptr CInt |
|
| -> IO (Ptr Void) |
Read all the output from a process.
If a process was created with I/O enabled, you can use this function to read the output. This function blocks until the process is complete, capturing all output, and providing the process exit code.
The data is allocated with a zero byte at the end (null terminated) for convenience. This extra byte is not included in the value reported via datasize.
The data should be freed with free.
- Returns
- the data or NULL on failure; call
getErrorfor more information. - Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReadProcess. The safe flavor isreadProcessSafe: blocks until the process closes its output. - C declaration
SDL_ReadProcess, defined atSDL3/SDL_process.h 308:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> Ptr CSize |
|
| -> Ptr CInt |
|
| -> IO (Ptr Void) |
Read all the output from a process.
If a process was created with I/O enabled, you can use this function to read the output. This function blocks until the process is complete, capturing all output, and providing the process exit code.
The data is allocated with a zero byte at the end (null terminated) for convenience. This extra byte is not included in the value reported via datasize.
The data should be freed with free.
- Returns
- the data or NULL on failure; call
getErrorfor more information. - Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReadProcess. The unsafe flavor isreadProcess: blocks until the process closes its output. - C declaration
SDL_ReadProcess, defined atSDL3/SDL_process.h 308:36
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO (Ptr SDL_IOStream) |
Get the SDL_IOStream associated with process standard input.
The process must have been created with and pipe_stdio set to true, or with createProcess and createProcessWithProperties set to sDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_PROCESS_STDIO_APP.
Writing to this stream can return less data than expected if the process hasn't read its input. It may be blocked waiting for its output to be read, if so you may need to call and read the output in parallel with writing input.getProcessOutput
- Returns
- the input stream or NULL on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
createProcess,createProcessWithProperties,getProcessOutput
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetProcessInput. The safe flavor isgetProcessInputSafe. - C declaration
SDL_GetProcessInput, defined atSDL3/SDL_process.h 334:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO (Ptr SDL_IOStream) |
Get the SDL_IOStream associated with process standard input.
The process must have been created with and pipe_stdio set to true, or with createProcess and createProcessWithProperties set to sDL_PROP_PROCESS_CREATE_STDIN_NUMBERSDL_PROCESS_STDIO_APP.
Writing to this stream can return less data than expected if the process hasn't read its input. It may be blocked waiting for its output to be read, if so you may need to call and read the output in parallel with writing input.getProcessOutput
- Returns
- the input stream or NULL on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
createProcess,createProcessWithProperties,getProcessOutput
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetProcessInput. The unsafe flavor isgetProcessInput. - C declaration
SDL_GetProcessInput, defined atSDL3/SDL_process.h 334:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO (Ptr SDL_IOStream) |
Get the SDL_IOStream associated with process standard output.
The process must have been created with and pipe_stdio set to true, or with createProcess and createProcessWithProperties set to sDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_APP.
Reading from this stream can return 0 with getIOStatus returning SDL_IO_STATUS_NOT_READY if no output is available yet.
- Returns
- the output stream or NULL on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
createProcess,createProcessWithProperties,getProcessInput
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetProcessOutput. The safe flavor isgetProcessOutputSafe. - C declaration
SDL_GetProcessOutput, defined atSDL3/SDL_process.h 358:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO (Ptr SDL_IOStream) |
Get the SDL_IOStream associated with process standard output.
The process must have been created with and pipe_stdio set to true, or with createProcess and createProcessWithProperties set to sDL_PROP_PROCESS_CREATE_STDOUT_NUMBERSDL_PROCESS_STDIO_APP.
Reading from this stream can return 0 with getIOStatus returning SDL_IO_STATUS_NOT_READY if no output is available yet.
- Returns
- the output stream or NULL on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
createProcess,createProcessWithProperties,getProcessInput
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetProcessOutput. The unsafe flavor isgetProcessOutput. - C declaration
SDL_GetProcessOutput, defined atSDL3/SDL_process.h 358:44
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> Bool |
|
| -> IO Bool |
Stop a process.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,waitProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_KillProcess. The safe flavor iskillProcessSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_KillProcess, defined atSDL3/SDL_process.h 381:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> Bool |
|
| -> IO Bool |
Stop a process.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,waitProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_KillProcess. The unsafe flavor iskillProcess. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_KillProcess, defined atSDL3/SDL_process.h 381:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> Bool |
|
| -> Ptr CInt |
|
| -> IO Bool |
Wait for a process to finish.
This can be called multiple times to get the status of a process.
The exit code will be the exit code of the process if it terminates normally, a negative signal if it terminated due to a signal, or -255 otherwise. It will not be changed if the process is still running.
If you create a process with standard output piped to the application (pipe_stdio being true) then you should read all of the process output before calling . If you don't do this the process might be blocked indefinitely waiting for output to be read and waitProcess will never return true;waitProcess
- Returns
- true if the process exited, false otherwise.
- Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,killProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WaitProcess. The safe flavor iswaitProcessSafe: blocks until the process exits. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitProcess, defined atSDL3/SDL_process.h 414:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> Bool |
|
| -> Ptr CInt |
|
| -> IO Bool |
Wait for a process to finish.
This can be called multiple times to get the status of a process.
The exit code will be the exit code of the process if it terminates normally, a negative signal if it terminated due to a signal, or -255 otherwise. It will not be changed if the process is still running.
If you create a process with standard output piped to the application (pipe_stdio being true) then you should read all of the process output before calling . If you don't do this the process might be blocked indefinitely waiting for output to be read and waitProcess will never return true;waitProcess
- Returns
- true if the process exited, false otherwise.
- Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,killProcess,destroyProcess
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WaitProcess. The unsafe flavor iswaitProcess: blocks until the process exits. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitProcess, defined atSDL3/SDL_process.h 414:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO () |
Destroy a previously created process object.
Note that this does not stop the process, just destroys the SDL object used to track it. If you want to stop the process you should use .killProcess
- Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,killProcess
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DestroyProcess. The safe flavor isdestroyProcessSafe. - C declaration
SDL_DestroyProcess, defined atSDL3/SDL_process.h 433:34
Since: 3.2.0
Arguments
| :: Ptr SDL_Process |
|
| -> IO () |
Destroy a previously created process object.
Note that this does not stop the process, just destroys the SDL object used to track it. If you want to stop the process you should use .killProcess
- Thread safety
- This function is not thread safe.
- See also
createProcess,createProcessWithProperties,killProcess
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DestroyProcess. The unsafe flavor isdestroyProcess. - C declaration
SDL_DestroyProcess, defined atSDL3/SDL_process.h 433:34
Since: 3.2.0