Native Linux backtrace.

This commit is contained in:
Christoffer Lerno
2023-11-11 14:16:36 +01:00
committed by Christoffer Lerno
parent f39aa1a41e
commit dc0aa35522
15 changed files with 343 additions and 110 deletions

View File

@@ -269,6 +269,13 @@ fn ZString* tcopy_env(String[] environment) @local @inline @if(env::POSIX)
return copy;
}
fn String! execute_stdout_to_buffer(char[] buffer, String[] command_line, SubProcessOptions options = {}, String[] environment = {})
{
SubProcess process = process::create(command_line, options, environment)!;
process.join()!;
usz len = process.read_stdout(buffer.ptr, buffer.len)!;
return (String)buffer[:len - 1];
}
/**
* @require !environment || !options.inherit_environment