const char command_line[] = {"echo", "\"Hello, world!\"", NULL};
struct process_s process;
int result = process_create(command_line, &process);
if (0 != result) {
// an error occurred!
}
however process_create takes an integer bitfield of process_option_e.
The code also has const char command_line[] = {"echo", "\"Hello, world!\"", NULL};, which isn't valid at least on msvc. Needed to be changed to const char* command_line[] = {"echo", "\"Hello, world!\"", NULL}; (note the type)
After making this change and providing process_option_e::process_option_combined_stdout_stderr and 0, both times this example code gives me a -1 result, and the exit code is -1.
Readme informs to create a process like so:
however process_create takes an integer bitfield of
process_option_e
.The code also has
const char command_line[] = {"echo", "\"Hello, world!\"", NULL};
, which isn't valid at least on msvc. Needed to be changed toconst char* command_line[] = {"echo", "\"Hello, world!\"", NULL};
(note the type)After making this change and providing
process_option_e::process_option_combined_stdout_stderr
and0
, both times this example code gives me a -1 result, and the exit code is -1.